`
查某个app的包名
adb -s 8a8917c9 shell pm list packages | grep 'mhxy'
关闭app
def close_app():
os.system("adb -s "+ str(iphone_id)+ " shell am force-stop com.netease.mhxyhtb")
启动app
启动app不仅需要知道app的包名,还需要知道app的类名.
相关启动指令是os.system("adb -s "+ str(iphone_id)+ " shell am start -n com.android.settings/com.android.settings.Settings")
获取目标应用的包名及初始化 Activity
adb -s 113038e shell dumpsys activity | grep -i run
返回Run #0: ActivityRecord{f63223c u0 com.netease.htb/.Client t147}
类似com.netease.htb
就是包名,.Client
就是类名.
如果无法查到app的类名,就只能用点击的方式去启动app了.
部分系统程序的包名及类名
com.android.settings/com.android.settings.Settings 打开系统设置主界面
com.android.settings/com.android.setting