Android 小技巧及工具

adb 常用命令整理

2018-04-20  本文已影响45人  siriusing

adb,即安卓调试桥。

adb整理

adb shell uiautomator dump /sdcard/filename.xml
adb pull /sdcard/filename.xml filename.xml
adb shell uiautomator dump 
adb shell screencap -p --compressed /sdcard/screen.png
adb pull /sdcard/screen.png 


--compressed

adb shell screenrecord /sdcard/demo.mp4
# ctrl + C结束录制
adb shell screenrecord --bit-rate 5000000 /sdcard/demo.mp4
adb shell screenrecord --time-limit <TIME>

adb shell screenrecord --verbose /sdcard/demo.mp4 # 可以控制台输出日志
adb pull /sdcard/demo.mp4
adb shell uiautomator dump /sdcard/filename.xml
adb pull /sdcard/filename.xml filename3.xml
input text <string>
    input keyevent <key code number or name>
    input tap <x> <y>
    input swipe <x1> <y1> <x2> <y2>

adb shell input tap 800 50
adb shell input keyevent 3

home键的keycode=3,back键的keycode=4.

adb shell input swipe 250 250 300 300
adb shell am start -a android.intent.action.CALL -d tel:1008611
adb shell service call phone 2 s16 1008611
adb shell am start -a android.intent.action.VIEW -d  http://gityuan.com
adb shell settings get global multi_sim_voice_call
adb shell am start -a android.intent.action.SENDTO -d sms:10086 --es sms_body "hello" --ez exit_on_sent true
adb shell dumpsys package>package.txt
adb shell am start -n 包名 /. 类名
adb shell am start -n com.android.camera/.Camera
adb shell am start -n com.taobao.taobao/com.taobao.search.mmd.SearchResultActivity -es sirius
adb shell pm list packages
adb shell pm list packages -f See their associated file.
adb shell pm list packages -d Filter to only show disabled packages.
adb shell pm list packages -e Filter to only show enabled packages.
adb shell pm list packages -s Filter to only show system packages.
adb shell pm list packages -3 Filter to only show third party packages.
adb shell pm list packages -i See the installer for the packages.
adb shell pm list packages -u Also include uninstalled packages.
adb shell pm list packages --user <USER_ID> The user space to query.
adb shell pm path com.android.phone
adb shell pm clear com.test.abc
adb shell dumpsys batterystats --reset erases old collection data
adb shell dumpsys gfxinfo com.android.phone
上一篇 下一篇

猜你喜欢

热点阅读