Appium+Python 安卓APP自动化测试:安装app和卸载app

from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '7.1.2'
desired_caps['deviceName'] = 'Nexus'
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

if driver.is_app_installed('com.***.***'):
    driver.remove_app('com.***.***') # 卸载app
else:
    driver.install_app('E:\Android\***.apk') # 安装app

driver.quit()

 

posted @ 2021-04-08 14:42  OTAKU_nicole  阅读(380)  评论(0)    收藏  举报