from appium import webdriver
def connect(self):
self.desired_caps = {}
self.desired_caps['platformName'] = 'Android'
self.desired_caps['platfornVersion'] = '4.4.4'
self.desired_caps['deviceName'] = 'Samsung Galaxy S4-4.4.4'
self.desired_caps['appPackage'] = 'xx'
self.desired_caps['appActivity'] = 'xx'
#以上二项通过android sdk中的hierarchyviewer.bat获得
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', self.desired_caps)
self.driver.implicitly_wait(60)