adb 命令
冷启动、热启动:
冷启动 ----后台没有运行目标程序为前提,启动目标程序
热启动 ----后台已运行目标程序,点击目标程序图标启动程序 (就是一个冷启动之后后台运行,再启动)
APP启动流程:
1.用户点击ICON
2.系统开始启动应用-->创建第一个activity
细节可以参考这个小姐姐的https://blog.csdn.net/huangliniqng/article/details/89364064
3.渲染加载
ADB命令:
app启动:
adb shell am start -W - n packgename/activit
冷启动停止:
adb shell am force-stop packgename
热启动停止:
adb shell input keyevent 3
其他常用命令:
获取当前运行app的packgename和activity
adb shell dumpsys activity recents | find "intent={"
已有apk 获取 apkname/activity
aapt dump badging apk_path | find "packge:name" aapt dump badging apk_path | find "launchable-activity"
安装apk/卸载apk
adb install apk_path #安装 adb uninstall apk_path #卸载
获取手机信息
adb devices #获取手机设备连接信息 adb shell dumpsys window policy | findstr "mAwake=" #获取屏幕是否亮着 adb shell ps | findstr "apk_name" #获取对应app进程号 adb shell ps | findstr "monkey" #获取monkey进程号 adb shell cat /proc/meminfo | findstr "MemToal" #获取总内存信息 adb shell cat /proc/cpuinfo" #获取cpu信息 adb shell wm size | find "Physical size:" #获取手机分辨率 adb shell pm list package -3 #获取第三方包名列表 adb shell dumpsys window windows | findstr "mFocusedApp" #获取当前窗口运行apkname 和 activity
adb shell dumpsys activity top | grep ACTIVITY # 获取当前窗口运行的包名和activity adb shell getprop ro.product.brand #获取手机品牌 adb shell getprop ro.build.version.release #获取系统版本信息 adb shell getprop ro.product.model #获取手机名称 #实时获取信息 adb shell dumpsys cpuinfo | findstr apk_name #获取app运行时cpu信息 adb shell dumpsys meminfo apk_name | findstr "TOTAL"#获取app运行时内存信息 adb shell dumpsys gfxinfo apk_name framestats #获取帧率(需要计算) adb shell dumpsys battery | findstr "level" #获取手机电量信息 adb shell cat /proc/app进程号/net/dev #获取app使用流量信息(上下行)
#获取手机日志
adb logcat -d
#---有问题的话请指正,感谢!---#

浙公网安备 33010602011771号