ADB was specifically designed for Android developers, but there are many useful things you, as a regular consumer, can do with ADB. These include sideloading applications, rooting your phone, transferring files between your phone and your computer, creating backups, and recording your screen. But how do you get started with it?
Install ADB on Windows
- Download the Platform Tools for Windows. (You can download it for Mac or Linux, too, on the same web page.)
- Extract the zip file after download. You may find it useful to save it in your “C:” drive or Home folder (in Linux) to make it easy to find.
- Open the folder platform-tools and hold down the Shift key while right-clicking on the folder.
- Choose the option to “Open PowerShell window here.” (It could say, “Open command window here” on some computers.) When you finish these steps, ADB is set up on your computer. The next step is to enable USB debugging on your phone.
Enable USB Debugging on your Android mobile device
The steps for enabling USB debugging may vary slightly on different Android phones. However, it will be very similar to the steps below.
- Go to your phone’s settings.
- Click on “About Phone -> Software Information.”
- Scroll down to the Build number, and tap on it seven times to unlock developer options.
- Go back to the About Phone screen, and Developer options should be listed as a choice. Tap that option.
- Click to enable USB debugging, and confirm that you are choosing to do this.
- Connect your phone to your PC.
- When the message appears that says, “Allow USB debugging,” choose “Allow.” It is a good idea to check the option to “Always allow this computer” if you are using a computer you trust. It makes the experience you will have when using ADB smoother and enables you to rescue data from a phone that is no longer working.
Test ADB
To determine if the connection between your phone and computer are working, test ADB by running the same steps you did to open the command prompt above.
- Connect your phone to your PC.
- Type adb devices in the command window and hit Enter.
- If it lists your device, you have successfully made the connection.
What if it doesn’t work?
If you do not see the message on your phone that says, “Allow USB debugging,” after you have set everything up, don’t panic. The fix may be as easy as restarting your phone or changing the options for USB to transferring images or MIDI. If it still doesn’t appear, try running the ADB test. If you get some scary-looking red text telling you that “ADB is not recognized as an internal or external command … ” try the following steps. They will add system variables for ADB to your computer.
- Go to Oracle’s official website.
- Scroll down to find the links for all the available options for Java SE to download.
- Select “dk-12.0.1_windows-x64_bin.exe.” (That is the latest version as of this post.)
- Download JavaSE.
- Double-click on the setup file to install it.
- After the Java installation finishes, right-click on the icon for My Computer in Windows Explorer.
- Select “Properties.”
- In the window that opens, select Advanced System Settings.
- Click on the “Environment variables” button.
- Select the path listed in the bottom box of the window and click Edit.
- Click on “Browse” and navigate to the folder where you earlier saved your platform-tools folder.
- Select the folder, platform-tools, and click OK.
- Now, in Windows Explorer, navigate back to the platform-tools folder, and open the command prompt the way you did in the beginning.
- In the command prompt, type adb devices. Your device should show up now. If your device is “unauthorized,” check your phone. The USB debugging box should be visible now. Allow your computer access to your phone, and you are set up and ready to use ADB!