adb shell dumpsys | grep Focus 找到当前获取焦点的activity
grep 内容 -r 路径 --include=*.后缀 找到指定路径下包含指定内容,指定后缀的文件_______________________________________________________________________________________________________________________________________
使用adb查看应用程序内存使用情况可按如下格式在命令行里查看内存使用情况:adb shell dumpsys meminfo <package_name>_______________________________________________________________________________________________________________________________________通过命令行执行adb shell am broadcast发送广播通知。adb shell am broadcast 后面的参数有:[-a <ACTION>][-d <DATA_URI>][-t <MIME_TYPE>] [-c <CATEGORY> [-c <CATEGORY>] ...] [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...] [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...] [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...] [-n <COMPONENT>][-f <FLAGS>] [<URI>]例如:adb shell am broadcast -a com.android.test --es test_string "this is test string" --ei test_int 100 --ez test_boolean true________________________________________________________________________________________________________________________________________adb 启动Activityadb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n breakan.test/breakan.test.TestActivity或简单一些。adb shell am start -n breakan.test/breakan.test.TestActivity其中"breakan.test/breakan.test.TestActivity"中的"breakan.test"是程序的包名,"TestActivity"是程序Activity类的类名。________________________________________________________________________________________________________________________________________adb 启动serviceadb shell am startservice -n {包(package)名}/{包名}.{服务(service)名称}如:启动自己应用中一个service# am startservice -n com.android.traffic/com.android.traffic.maniservice________________________________________________________________________________________________________________________________________通过adb 命令拨打电话 adb shell service call phone 2 s16 "10086"(呼叫的号码) 通过adb 命令发送短信,需要两步 adb shell am start -a android.intent.action.SENDTO -d sms:10086(发送目的号码) --es sms_body "hello"(短信内容) --ez exit_on_sent true adb shell input keyevent 66 // 模拟发送按键 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————