from appium import webdriver
from time import sleep
#关于手机配置信息 字典形式 key = value 平台名称、版本、设备名、包名、界面名
desires_caps = {}
desires_caps['platformName'] = 'Android'
desires_caps['platformVersion'] = '5.0'
desires_caps['deviceName'] = '192.168.135.103:5555'
desires_caps['appPackage'] = 'com.android.settings'
desires_caps['appActivity'] = '.Settings'
#驱动 从webdriver的Remote类里传入两个参数("字符串",字典)
driver = webdriver.Remote('http://localhost:4723/wd/hub', desires_caps)
#设置静止时间,使现象更明显
sleep(5)
#退出
driver.quit()