What is ADB ?
ADB is the acronym for Android Debug Bridge. It is a versatile command line program and one of the most useful developer tools available for android, it helps you communicate with you android device and perform a host of tasks from your PC (computer). ADB is primarily used as a debugging tool for android developers.
Adb can be used for many tasks like;
Flashing custom ROMs,
Bypassing android lockscreen password, pin or pattern,
Installing an android app from your computer,
Rooting android phones,
Record screen,
Change screen density,
Capture screenshots,
Perform factory reset,
Make nandroid backups and many more.
Full details on how to perform these tasks and more would be posted later
Installing ADB
For the installation
Download android SDK platform tools (software development kit) and extract it. Click here to download SDK package
Note the directory where the SDK platform tools is extracted.
Open file explorer in your PC and navigate to the extracted directory. Its usually located here C:\Users\Dell\AppData\Local\Android\android-sdk\platform-tools
Preparing your PC for running ADB commands
After installation add the ADB file path to your windows environment path variable. To do this
Open Start menu
Right click Computer and click Properties
Click Advanced System settings
Click environmental Variables
- Under system variables click path and click edit
- Press “ ; ” without quotes then paste the adb file directory (i.e. ADB installation path), then click OK.
- Click OK again then reboot the computer
Note: Before running any command in adb you need to install the universal adb drivers. Click here to download it.
Now you can run adb commands whenever you open command prompt without navigating to the ADB installed path.
To check if ADB is working correctly
Connect your phone to your computer
Open command prompt (windows key + R, type cmd then press enter)
Type adb devices and press enter.
This command will display a list of all connected android devices, emulators with their serial number.
Now you have confirmed that Adb is working correctly.
Connecting your device
Before adb command through your computer you need to enable android debugging on your phone.
To enable it follow the steps below.
Open settings and go to Developer options
If no developer options
Scroll down and tap Build number continuously until you see a message saying You are now a developerNow go back and tap Developer options and switch it on
Scroll down switch on USB debugging
Note: When you connect your Phone to your PC, the phone displays a dialog box requesting permission to accept the RSA (Rivest–Shamir–Adleman) key which allows debugging through your PC. This is to ensures that adb exucutable commands cannot run unless you unlock the phone and permit it to.
To run adb commands wirelessly follow the steps below;
Connect the android phone first through a USB cable
Connect your Android devices and your PC to a Wifi network accessible to both.
Open command prompt and type adb tcpip 5555
Disconnect the USB cable from the device.
Type adb connect xxxxxxxx replace xxxxxxx with your device IP address
You can see your IP address here Settings > About Phone > Status > IP address
Now you can run adb commands remotely.
Sources
ADB setup
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://developer.android.com/studio/command-line/adb.html