This guide and the information indulged in it, is meant for anyone and everyone related to Android. You shall find its necessity at several occasions like taking logs, flashing firmware images, updating phone software, flashing ROMs/Recoveries even while developing a ROM/Kernel/Application. So, from users to developers, it will come in handy.
What is ADB?
ADB or Android Debug Bridge, is a fully equipped and loaded command-line tool which is put to use in order to communicate with an Android device. ADB tool is provided along side the Android SDK and one could easily find this tiny but versatile tool under
It comprises of three basic and important components:
- The Client
It is what runs on your development machine - The Server
It is held responsible for communication between the client and daemon running on a device/emulator - The Daemon
It runs as a background process on each device/emulator instance
How to Setup ADB on Windows
- Download the Android SDK package for Windows [Android SDK]
- Extract the zip files to your C:\ drive. Now you have a folder android-sdk-linux
- Double click on SDK Manager to initiate the SDK manager. You shall perceive the following window.
- Make sure everything is un-ticked. Now select Android SDK Platform-tools and install it.
- During the next window, you will be prompted. Accept the license and click on Install.
- When the installation is complete, close the window.
- The SDK manager has now download the platform-tools successfully, which certainly includes our prior ADB.
- The next step is to define the path where ADB is present.
- Go to C:\android-sdk-windows\platform-tools and take note of this path.
- Go to desktop, right click on Computer and select Properties.
- On the left pane, click on Advanced System Settings and a new window shall open.
- Select Environment Variables under Advanced tab.
- Select Path variable and click edit.
- Now add the path we noted in step #9 to the variable value and hit OK.
- Confirm and apply all the changes.
- To confirm that ADB has been configured properly, open CMD window and type in:adb
- You now have ADB successfully installed and configured on your Windows machine.
1. Turn on ADB
Go to Menu; Settings; Applications; Development; USB Debugging
2. Running ADB
Open up command prompt and type your way to the directory you have your SDK in.
Mine is in C:\
So for example, mine would be: cd c:\AndroidSDK/tools
You are now in
3. Basic ADB commands
ADB push (sends files to your phone) -- adb push c:\example.apk /sdcard/example.apk
ADB pull (Receives files from your phone) -- adb pull /system/app/example.apk c:\example.apk
ADB install (installs application) -- adb install c:\example.apk
adb shell (Begins shell connection with phone)
adb reboot (reboots phone)
adb reboot recovery (reboots phone into recovery)
adb reboot bootloader (reboots the phone into bootloader/the white screen)
adb remount (remounts the system)
4. Commands to run while in ADB Shell
cd (changes directories) -- cd /system/app
ls (lists all files in the directory) -- cd /system/app
rm (removes files) -- rm /system/app/example.apk
cp (copies files) similar to cat -- cp /system/app/example.apk /sdcard/example.apk
cat (copies files) -- cat /system/app/example.apk > /sdcard/example.apk
exit (exits shell) -- exit
No comments:
Post a Comment