If you are an Android user, surely, you’ve already encountered ADB. Some people don’t really know its purpose even if they use it just because a tutorial said so. Some knows what it is for but confuses it with Fasboot because they pretty much do the same thing and come from the same package. If you are one of these people, this article will help you understand what it is furthermore.
Android Debug Bridge, or ADB for short, is a command line tool. You can do certain things on your device via your PC using this tool, which is ran by a command or terminal window. You just type and enter commands and then expect it to happen. You do not need to enter, for example, recovery mode manually, maybe because some of your buttons are broken or you have a hard time and get confused on pressing certain buttons. Instead, you can just enter adb reboot recovery, and it will do so.
This tool comes along with Fastboot, which lets you have control access via PC too because they run through the same terminal. But the main difference is, you only type in demands when normally booted up. While in Fasboot mode, you can key in demands and flash ROMs and rooting apps through entering Fastboot mode on bootloader.
Some of the common actions that ADB can do is reboot your device, enter bootloader and recovery mode, install apps and record screen output that will be exported as a video file.
So if you are in need of this tool, more often for rooting, the following steps will guide you thoroughly on how to install it to your PC, and how to use it.
Getting to Know ADB
Firstly, you have to locate the tool which is under <sdk>/platform-tools/ and can be invoked by simply running it from the command prompt or on a terminal. Now, you have to ensure that there is a running client, server and a working daemon which listens for RPC (Remote Procedural Calls) from the client to invoke the server.
Moreover, you have to make sure that you have connected your device in Debugging mode for you to use your device as an external development environment for your simulations. Along these lines, you have to make sure that you are running on android 4.4.2 or higher and ADB version 1.0.31 or higher if not the latest.
The syntax for invoking the tool is very simple. Simply use adb [-d|-e|-s <serialNumber>] <command>. This command will be sent to one emulator, if there is only one emulator running on your single connected device. Now if there is more then one device connected, then you have to specify using –d, -e, or –s to specify which device you wish to manipulate.
Installing an App
This is one of the capabilities of the application and you can easily do this by using the install command. Case in point adb install <path_to_apk>, if you are not an IDE. If you are using the likes of Eclipse, then these will have an ADT plugin which will automatically handle the packaging and installation of the application which you wish to test on your device.
You can copy files from an emulator or your device by using the pull command and then copy by using the push command. Case in point pull <local><remote> and push<local><remote> for from device and to device respectively.
There are many reasons while you might want to backup your data and knowing that it is always a necessary safeguard to have a copy of your data elsewhere, it is worth doing. You do not need to make any tweaks before having the need to have your details exported elsewhere as an alternative database. Do this as a precaution in case you get bricked
Terminating an App
Assuming that you are through with the application, then you might want to close it or restart it if it is not responding or buggy. You can do this using the kill-server command. You can then attach your desired number of devices and restart the server once again.
Generate logs for debugging/bug reporting
For those who are a bit more tech – savvy, looking at logs gives a clue as to what went wrong or provides a history on your background processes and updates.
There are a number of tools that help to make user experience of ADB a smooth one and some Graphical User Interface (GUI) can be just perfect to save you time and make your work easier. They help to issue commands and help you find your way around vital tweaks that will enhance what you can get.
You will need to have some important drivers installed to make your customization experience possible. These drivers make it possible for your device to be detected when connected to your PC. Thereby enabling syncing, exchange of data and other necessary steps that you intend to explore.
Download Minimal ADB and Fastboot. Run the file with administrative privileges. A command window will appear to confirm your installation, so just enter ‘Y’ for yes on every question that will appear.
The installation wizard will then appear, so just click next and wait for it to finish. The wizard will automatically close and then you are done! You now have Android Debug Bridge installed.
How to Use ADB
Reminder: This is for Windows users only.
Download and install the correct drivers for your device. This will update the needed drivers to properly connect to your PC.
In your device, go to Settings. Look for the ‘About’ option and tap it. When inside, select ‘More’. Tap and tap the ‘Build Number’ option until a notification appears. It will say that you are already a developer.
Go back to Settings and the ‘Developer options’ should already be present on the list. Tap it. Look for ‘USB debugging’ and make sure to tick the box beside to put a check mark. This is important because turning this on lets your device be read as controllable on PC and not just recognize it as a simple storage drive.
Plug in to PC.
Go to My Computer > Local Disk C: (or whatever the letter of your system drive is) > Program Files (x86)/Program Files > Minimal ADB and Fastboot folder. Inside this folder, hold Shift key while right clicking. You should see the right click selection but with an added command window option. Click that. Now, a window will appear.
Enter adb devices to check if your device is successfully recognized and read as a controllable one. Its serial number should appear.
There are a lot of commands which are sued to interact with the app. These are categorized into 8 main categories, all of which play a specific role.reboot – you will reboot
– reboot–bootloader – enter bootloader mode
– push (name of file) (specify path) – copy and paste files externally to internal storage or SD card
– pull (name of file) (current file path) (target path on PC) – copy and paste files to external path
– install -r (APK path) – install apps
– shell screenrecord (destination path/desired file name) – record screen output
Have fun and make sure to check out the video below for more commands!