ADB Command

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Kaushal.comp@gmail.

com

Using the Android Debug Bridge (ADB)

using the adb tool you can shell into the running emulator, or any
real device connected through USB.

$ adb devices
List of devices attached
emulator-5554 device
0000021459584822 device
emulator-5556 offline

$adb -s 0000021459584822 shell

$id

$su

device manufacturers have been very reluctant for various reasons to


give root access to their devices and have put in a number of
provisions to make that as difficult as possible, if not impossible.
That’s why “rooting” devices is held up as a holy grail by many power
users and hackers.

$adb logcat
to dump the data contained in the main logger buffer

copy files to and from the device:


$ adb push data.txt /data/local
$ adb pull /proc/config.gz

$ adb kill-server
to start the adb server manually,
$adb start-server

$adb version

remote device whose adbd daemon is running on TCP/IP


instead of USB, you can use the connect command:

$ adb connect 192.168.202.79:7878

$adb -s 192.168.202.79:7878 shell

$ adb disconnect 192.168.202.79:7878

inquire about a device’s status, type:


$ adb -s 0123456789ABCDEF get-state

$cat /proc/cpuinfo

$adb reboot
$adb reboot recovery

$ls
$cd data

$ls
/anr ANR traces.
/app Default install location for apps.
/backup For use by the BackupManager system service.
/dalvik-cache Holds the cached JIT’ed b versions of all dex files.
/data Contains one subdirectory for each app installed on the system. In
effect, this is where each app’s “home” directory is located.
/system Systemwide data, such as the accounts database and the list of
installed packages.

$ls -l /data/user/
$ls -l /data/user/0/

$service -h

$service check power


$dumpsys

$am
$am start -a android.intent.action.VIEW -d http://source.android.com
$logcat
$
$am monitor

$pm
$pm list packages
$pm install FastBirds.apk
$pm uninstall com.acme.fastbirds

-----how to access avd through command line-----


-To connect to AVD
telnet localhost 5554

-To send an SMS message to the emulator, use the following


command:
sms send +11111 HI!

- To make a phone call


gsm call +1234567

You might also like