一、所需工具
- JDK
- Node.JS
- Android SDK
- Appium
- Python
- Appium-Python-Client
- 模拟器MuMu
- Appium-Inspector
- pytest+allure
二、工具下载与安装
1. JDK
- 下载地址:
https://pan.baidu.com/s/1ozCGy53AIeQIHWL6s9oAbw 提取码:04lf
- 安装: 根据提示安装
- 环境变量配置:
- 添加Path路径:
- 安装验证:
2. Node.JS
- 下载地址:
- 安装:
根据提示安装
- 环境变量配置:
- 添加Path路径:
- 安装验证:
3. Android SDK
- 下载地址:
https://www.androiddevtools.cn/
- 设置环境变量:
- 添加Path路径:
- 安装验证:
- 根据需要安装tools
4. Appium(2.0)
- 安装命令:
npm --registry http://registry.npm.taobao.org install appium –g
- 安装驱动:
appium driver install 驱动名称
- 安装验证:
- 服务启动命令:
appium
5. Python
- 下载地址:
- 安装:
默认安装,勾选添加环境变量
6. Appium-Python-Client
- 安装命令:
pip install -i https://mirrors.aliyun.com/pypi/simple/ Appium-Python-Client==2
7. 模拟器MuMu
-
下载地址:
-
安装:
根据提示安装即可
8. Appium-Inspector(开发者工具)
-
下载地址:
Releases · appium/appium-inspector · GitHub
Github加速器:https://github.ur1.fun/
- 安装:
根据提示安装即可
9. pytest+allure
- pytest安装命令:
pip install pytest
- allure下载地址:
Central Repository: io/qameta/allure/allure-commandline
- 解压并配置环境变量:
解压路径为 D:\allure-2.17.3 , 将D:\allure-2.17.3\bin 配置到环境变量path中
- 验证:
- 安装allure-pytest插件命令:
pip install allure-pytest
三、环境使用流程
1. 双击启动模拟器
2. 绑定执行器
adb devices 查看已绑定的手机信息(模拟器)
adb connect 127.0.0.1:7555 绑定模拟器信息
注:127.0.0.1为本地地址,7555端口是mumu的默认端口号
3. 启动appium
命令行:appium
4. 使用appium开发工具调试
- 其中,包名称与活动名称获取方式(app启动后):
adb logcat | findStr 'Start'