adb kill-server
adb start-server
adb devices
adb shell ifconfig wlan0
adb push /Users/caochang/apk/BBox.apk /sdcard/xbd/BBox.apk
adb pull /sdcard/xbd/BBox.apk /Users/caochang/apk/BBox.apk
adb shell dumpsys iphonesubinfo
adb -d shell getprop ro.product.brand
adb -d shell getprop ro.product.model
adb shell getprop ro.build.version.sdk
adb shell wm size
adb shell wm size 1080*1920
adb shell wm density
adb shell wm density 480
adb shell getprop ro.product.cpu.abilist(Android5.0系统之后)
adb shell getprop ro.product.cpu.abi(Android5.0系统之前)
adb shell settings get system screen_off_timeout
adb shell settings get secure sms_default_application
adb shell settings put secure sms_default_application com.carlos.sms
adb shell "dumpsys window policy | grep mScreenOnFully"
adb shell dumpsys power | findstr "Display Power:state="
adb shell am start
-W: wait for launch to complete
-S: force stop the target app before starting the activity
例adb shell am start -W com.UCMobile/com.uc.browser.InnerUCMobile
在AS中可过滤displayed
输出的启动日志
adb shell dumpsys cpuinfo| find "com.sec.android.app.launcher"
adb shell "dumpsys meminfo | grep com.carlos.bbox
adb shell "ps | grep com.aspire.agent" 得到结果第二列的值为pid
adb shell cat /proc/6094/status
adb shell "cat /proc/uid_stat/10189/tcp_snd"
adb shell "cat /proc/uid_stat/11110/tcp_rcv"
adb shell dumpsys dropbox --print >>crashlog_$(date +%Y%m%d%H%M).txt
adb shell pm list packages [-com.carlos.bbox]
adb shell pm clear com.carlos.bbox
adb uninstall com.carlos.bbox
adb install (-r强制安装) /Users/caochang/apk/BBox.apk
adb shell pm install (-r) /sdcard/xbd/BBox.apk
adb install-multiple -r /Users/caochang/apk/BBox.apk
adb shell am broadcast -a com.carlos.bbox -e port 8888
adb shell am startservice com.carlos.bbox/com.carlos.bbox.MyService
adb shell am start -n com.carlos.bbox/.MainActivity
adb shell am froce-stop com.carlos.bbox
adb shell pm path com.carlos.grabredenvelope
adb pull /data/app/com.example.carlos.myapplication--y9EFnP-__j34XhQxIwXvA==/base.apk(找到的apk路径)
adb shell dumpsys activity top > info.txt
adb shell monkey -p com.codemao.dan -v 1000
adb shell monkey -p com.codemao.dan --throttle 1000 20
adb shell input tap 250 250
adb shell input text hello world
adb shell screencap -p /sdcard/a.png
查询手机串号(IMEI)
*#06#
首先进入操作系统的拨号界面,输入指令码即可快速进入Android的工程测试模式。
常见机型进入工程模式的指令码是:
adb jdwp
在某些手机上进入到package文件夹下执行ls命令会出现以下问题,参考链接:opendir failed, Permission denied
opendir failed, Permission denied
此时,可先run-as your-package命令,如
run-as com.carlos.test
remote open failed: Permission denied