1.Python安装,正常安装,添加环境变量
2.安装Android sdk,添加环境变量
ANDROID_HOME D:\Program Files(x86)\Android\android-sdk
%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;
3.安装Java,并设置环境变量
4.安装node.js
5.安装appium,添加环境变量
D:\Program Files(x86)\Appium\node_modules\.bin
6.安装appium Python client,会自动安装selenium
pip install Appium-Python-Client
查看环境配置结果
7.Android sdk下载自己需要的工具
8.avd manager配置虚拟设备
'''from selenium impor twebdriver
from time import *
desired_caps = {}
#aapt dump badging apk_path 获取package和activity(lunchable_activity)信息
#desired_caps['appPackage'] ='com.taobao.taobao'
#desired_caps['appActivity'] ='com.taobao.tao.welcome.Welcome'
desired_caps['platformName'] ='Android'
desired_caps['deviceName'] ='avd2'
desired_caps['appPackage'] ='com.tencent.mm'
# desired_caps['appActivity'] ='.Calculator'
desired_caps['appActivity'] ='.ui.LauncherUI'
# desired_caps['appActivity'] ='.plugin.webview.ui.tools.WebViewUI'
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_caps)
driver.implicitly_wait(300)'''
中文输入
desired_caps["unicodeKeyboard"] ="True"
desired_caps["resetKeyboard"] ="True"
cq=driver.find_element_by_name(u"重庆").click()
1.打开模拟器
2.打开appium,配置环境
3.
4.运行脚本
5.观察结果