1.0 定义
PATH = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
2.0 使用
PATH("biquge.apk")
3.0 appium的相关配置项
desired_caps = {
‘platformName‘: ‘Android‘,
‘deviceName‘: ‘127.0.0.1:62001‘,
‘platformVersion‘: ‘7.0‘,
‘app‘: PATH(‘biquge.apk‘),
‘appPackage‘: ‘com.biquge.biquge‘,
‘appActivity‘: ‘com.biquge.activity.Welcome‘,
‘noReset‘: ‘true‘,
# ‘resetKeyboard‘: ‘true‘,
# ‘unicodeKeyboard‘: ‘true‘
}
driver = webdriver.Remote(‘http://127.0.0.1:4723/wd/hub‘, desired_caps)