首页 > 编程学习 > appium安装apk包,返回package、activity

appium安装apk包,返回package、activity

发布时间:2022/9/6 17:31:23
from appium import webdriver


def get_app_info(apk):
    """
   dinghanhua 2022-09
:param apk_path: apk路径,不要包含中文 :return: package,activity """ desired_caps = dict() desired_caps['platformName'] = 'Android' # 安卓 desired_caps['platformVersion'] = '7' # 版本 desired_caps['deviceName'] = 'Android7' desired_caps['app'] = apk # 路径 desired_caps['noReset'] = True # 保留数据 driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) # appium 安装apk package = driver.current_package # 获取package activity = driver.current_activity # 获取activity return package, activity apk = r"D:\test_app.apk" print(get_app_info(apk))

 

Copyright © 2010-2022 mfbz.cn 版权所有 |关于我们| 联系方式|豫ICP备15888888号