ADB Shell Commands
ADB Shell Commands
ADB Shell Commands
ADB Debugging
1.)adb devices
adb devices
adb kill-server
Wireless
1.)adb connect
STEP 3.
connected to #.#.#.#:5555
STEP 6.
Remove USB cable from device, and confirm you can still access device:
adb devices
2.)adb usb
adb usb
Package Manager
1.)adb install
2.)adb uninstall
Prints all packages, optionally only those whose package name contains the text in <FILTER>.
adb shell pm list packages [options] <FILTER>
adb shell pm list packages -i See the installer for the packages.
package:/system/priv-app/TeleService/TeleService.apk
5.)adb shell pm clear
File Manager
1.)adb pull
adb shell
STEP 2.
ls
4.)adb shell cd
change directory
cd <directory>
STEP 1.
adb shell
STEP 2.
cd /system
5.)adb shell rm
adb shell
STEP 2.
rm /sdcard/test.txt
make directories
mkdir [options] <directory name>
mkdir /sdcard/tmp
adb shell
STEP 2.
touch /sdcard/tmp/test.txt
ls /sdcard/tmp
8.)adb shell pwd
9.)adb shell cp
adb shell
STEP 2.
cp /sdcard/test.txt /sdcard/demo.txt
10.)adb shell mv
adb shell
STEP 2.
Network
network statistics
netstat
STEP 1.
adb shell
STEP 2.
netstat
adb shell
STEP 2.
ping www.google.com
ping www.google.com -c 4
adb shell
STEP 2.
netcfg
4.)adb shell ip
adb shell
STEP 2.
Logcat
1.)adb logcat
adb logcat
adb logcat *:V lowest priority, filter to only show Verbose level
adb logcat -g Prints the size of the specified log buffer and exits.
adb logcat -v raw Display the raw log message, with no other
metadata fields.
Notes: A mobile device with Developer Options enabled running Android 5.0 or higher.
Notes: Battery Historian converts that data into an HTML visualization. STEP 1 adb shell dumpsys
batterystats > batterystats.txt STEP 2 python historian.py batterystats.txt > batterystats.html
adb shell dumpsys batterystats --reset erases old collection
data
dumps state
Screenshot
recording the display of devices running Android 4.4 (API level 19) and higher.
adb shell screenrecord [options] <filename>
Notes: Stop the screen recording by pressing Ctrl-C, otherwise the recording stops automatically at
three minutes or the time limit set by --time-limit.
Sets the video size: 1280x720. The default value is the device's native display resolution (if
supported), 1280x720 if not. For best results, use a size supported by your device's Advanced Video
Coding (AVC) encoder.
Sets the video bit rate for the video, in megabits per second. The default value is 4Mbps. You can
increase the bit rate to improve video quality, but doing so results in larger movie files. The following
example sets the recording bit rate to 5Mbps: adb shell screenrecord --bit-rate 5000000
/sdcard/demo.mp4
Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes).
Displays log information on the command-line screen. If you do not set this option, the utility does
not display any information while running.
System
1.)adb root
restarts the adbd daemon with root permissions
adb root
2.)adb sideload
3.)adb shell ps
adb shell
STEP 2.
ps
ps -p
4.)adb shell top
adb shell
STEP 2.
top
adb shell
STEP 2.
getprop
getprop ro.build.version.sdk
getprop ro.chipname
adb shell
STEP 2.
setprop service.adb.tcp.port 5555
See Also adb shell getprop
How to install multiple android applications ( from apk
files) into device?
adb install application1.apk & adb install application2.apk & adb install applicaiton3