January 16, 2012

How to Use Android ADB Command Line Tool

Android Debug Bridge (adb) is a tool that lets you manage the state of an emulator instance or Android phone. ADB is bundled with Android SDK package that can be downloaded fromAndroid SDK download page. This tool is usefull for communicating with Android phone such as install application, copy files from/to device and perform some linux shell commands.


Target software: SetCPU_2.24.zip
ref: http://forum.xda-developers.com/showthread.php?t=505419

How to Install
  • Download and install Java SDK (Ex: jdk-6u21-windows-i586.exe)
  • Download Android SDK package (Ex: installer_r16-windows.exe)
  • Extract SDK package into anywhere on your drive (Ex: C:\Program Files\Android\android-sdk)
Phone Setup
In order to use ADB, you have to enable USB Debugging option in  phone settings (Settings->Applications->Development)

How to Use
  • Connect the phone to your pc/notebook usb port
  • Run Windows command line tool (cmd) and go to C:\Program Files\Android\android-sdk\tool
Update!!
New Android SDK puts adb executable file on \platform-tools directory instead of tool. So the path should be C:\Program Files\Android\android-sdk\platform-tools


Usefull Commands


1. Check connected phone
Syntax: adb devices


2. Login to Android shell
Syntax: adb shell




Note:
If you get ‘#’ after typing adb shell, you are already get root access on the phone, no need to type su. Otherwise if you get ‘$’ , type ’su’ to get root access (only for rooted device).

4. Install application

You can use adb to install aplication from your local drive into  phone.
Syntax: adb install appname.apk
Example:
D:\android-sdk-windows\tools\adb install D:\AnReboot.apk


5. Copy files from phone to local drive
Syntax: adb pull source [destination]
Example:
D:\android-sdk-windows\tools\adb pull /sdcard/arm11-dvm.zip
D:\android-sdk-windows\tools\adb pull /sdcard/arm11-dvm.zip D:\


6. Copy files from local drive to phone
Syntax: adb push source destination
Example:
D:\android-sdk-windows\tools\adb push D:\AnReboot.apk /sdcard



No comments:

Post a Comment

三個逗號俱樂部

《免責聲明》 本部落格不針對任何金融商品進行買賣建議, 內容來自公開資訊觀測站之分享與各大媒體之評論為主, 投資人應審慎評估並獨立判斷,切勿以本部落格資訊作為投資依據。 靜候 時機來臨;瞬間掌握重壓;享受 獲利奔馳。 -------------------------...