原文出处:http://www.cnblogs.com/wyx123/articles/4479676.html

#coding:utf-8
from appium import webdriver
from time import sleep

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.3'
desired_caps['deviceName'] = '192.168.56.101:5555'
#desired_caps['app'] = 'Calculator.apk'
desired_caps['appPackage'] = 'com.android.calculator2'
desired_caps['appActivity'] = '.Calculator'

dr = webdriver.Remote('http://192.168.10.177:4723/wd/hub', desired_caps)
sleep(3)

dr.find_element_by_id('com.android.calculator2:id/digit9').click()


↙↙↙阅读原文可查看相关链接,并与作者交流