1、启动一个模拟器(比如:mumu模拟器)
2、与模拟器建立连接
【win版】
adb connect 127.0.0.1:7555
adb shell
【mac版】
adb kill-server && adb server && adb shell
3、启动appium server
最后:创建文件demo.py,执行python demo.py
from appium import webdriver
desired_caps={}
desired_caps['platformName']='Android'
desired_caps['platformVersion']='6.0'
desired_caps['deviceName']='emulator-5554'
# com.android.settings/com.android.settings.Settings
desired_caps['appPackage']='com.android.settings'
desired_caps['appActivity']='com.android.settings.Settings'
driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
print("启动【设置】应用")
driver.quit()