1. 安装python
2. 安装pip
pip是一个安装和管理python包的工具
3. 安装appium client
在cmd中,pip intall Appium-Python-Client
4. demo
第一步:启动android模拟器。
第二步:启动appium
点击左上角有“机器人”的按钮:
然后点击右上角的“三角”按钮启动Appium。
第三步:写个python脚本,执行
#coding=utf-8
from appium import webdriver
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.4.2'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['appPackage'] = 'com.android.calculator2'
desired_caps['appActivity'] = '.Calculator'
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
driver.find_element_by_name("1").click()
driver.find_element_by_name("5").click()
driver.find_element_by_name("9").click()
driver.find_element_by_name("delete").click()
driver.find_element_by_name("9").click()
driver.find_element_by_name("5").click()
driver.find_element_by_name("+").click()
driver.find_element_by_name("6").click()
driver.find_element_by_name("=").click()
driver.quit()
原文出自虫师http://www.cnblogs.com/fnng/p/4579152.html