概述
一、adb命令启动应用
1. 使用os.sysytem()+monkey启动应用
adb shell dumpsys window windows | findstr "Current"
获取到当前打开app的包名和启动activity名称
adb shell am activity/service/broadcast -a ACTION -c CATEGORY -n NAME
def open_ATX(devices_id, packageName):
os.system('adb shell /data/local/tmp/atx-agent server -d')
os.system('adb shell monkey -p {1} -c android.intent.category.LAUNCHER 1'.format(devices_id, packageName))
if __name__ == '__main__':
devices_id = 'c2913bcb'
pkg_ATX = ' com.github.uiautomator'
open_ATX(devices_id,pkg_ATX)
2. 使用os.sysytem()+am start启动应用
'''
-a android.intent.action.MAIN 决定应用程序最先启动的Activity
-c android.intent.category.LAUNCHER 决定应用程序是否显示在程序列表里
'''
adb shell am start -n package/launch activity
adb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n package/launch activity
最后
以上就是朴素棒棒糖为你收集整理的APP——python 启动APP的全部内容,希望文章能够帮你解决APP——python 启动APP所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复