adb shell getprop ro.serialno
adb shell getprop ro.build.version.release
>4.2.2
adb shell getprop ro.build.version.sdk
>17
adb shell wm size
adb shell wm density
#查看日誌(實時顯示) >abd logcat -d #清除日誌 >adb logcat -c
#截圖保存至sdcard中 >adb shell screencap /sdcard/screencap.png #將截圖從sdcard中導出PC >adb pull /sdcard/screencap.png #刪除sdcard中的截圖 >adb shell rm /sdcard/screencap.png #截圖保存至PC >adb shell screencap -p | sed 's/\r$//' > screen.png #使用alias別名命令建立快捷命令 >alias screencap="adb shell screencap -p | sed 's/\r$//'" >screencap > screen.png
#錄製視頻 >adb screenrecode /sdcard/demo.p4
#啓動指定activity >adb shell am start -n packagename/activity #關閉應用程序 >adb shell am force-stop packagename
#清除應用程序數據 >adb shell pm clear packagename
adb shell input text "android"
adb shell input keyevent 4
Usage: input [<source>] <command> [<arg>...]
The sources are:
trackball
joystick
touchnavigation
mouse
keyboard
gamepad
touchpad
dpad
stylus
touchscreenpython
The commands and default sources are:
text <string> (Default: touchscreen)
keyevent [--longpress] <key code number or name> ... (Default: keyboard)
tap <x> <y> (Default: touchscreen)
swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen)
press (Default: trackball)
roll <dx> <dy> (Default: trackball)android