(一) Appium 材料包
提示:本文章内所介绍内容仅局限于Appium for Windows。
全部语言都是先写hello world!同理,全部的工具都是先搭建环境。Appium搭建环境的帖子网上一片片的,我就不累述了。
AppiumForWindows下载地址:https://bitbucket.org/appium/appium.app/downloads/
其中dmg后缀为mac系统使用,zip后缀为Windows系统使用。
AppiumForWindows源码下载地址:https://github.com/appium/appium-dot-exe
各语言范例:https://github.com/appium/sample-code/tree/master/sample-code/examplesphp
pip install Appium-Python-Client pip install robotframework-appiumlibrary
android-sdk下载地址:http://tools.android-studio.org/index.php/sdk/html
androidSDK配置环境变量:https://jingyan.baidu.com/article/f71d603757965b1ab641d12a.html node
执行 py.test+目录(py.test C:\sample-code-master\sample-code\examples\python\android_simple.py)
打开Windows命令提示符,输入“appium-doctor”命令:python
若是提示:“appium-doctor”不是内部或外部命令,找到Appium的安装目录,例如:android
C:\Program Files (x86)\Appium\node_modules\.bingit
关于appium-doctor运行时提示不是内部或外部的命令 1.必定要单独配置android_home (我以前是直接将D:\SDK\platform-tools;D:\SDK\tools;加到path里面会致使appnium-doctor运行时失败,缘由为Android_home未配置——将appium-doctor.cmd拖到cmd窗口运行便可看到) 在设置系统环境变量的地方新建ANDROID_HOME(右键点击个人电脑–>属性–>高级–>环境变量–>系统变量–>新建,注意是“系统变量”而不是“Administrator的用户变量”) 1)ANDROID_HOME=D:\SDK(android sdk所在目录) 2)在 path 中加入 %ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools; tools目录下运行android命令,platform-tools目录运行adb命令 2.配置appium_home 1)Appium_Home=C:\Program Files (x86)\Appium 2)path中加入%Appium_Home% 3.进入C:\Program Files (x86)\Appium\node_modules\.bin,运行appium-doctor便可成功。 4.第三步若是还不行就这样操做: Windows下把安装的appium文件夹的Appium\node_modules\.bin加到系统环境变量path中
adb devices List of devices attached 为空解决方法:github
一、到设备管理器查看驱动是否安装成功。android-studio
二、查看设备ID。查看方法app
三、肯定adb使用的 .android 目录是哪一个。通常是在 C:\Users\用户名\.android ,也有可能在sdk路径\.android。 修改所使用的.android 目录下的adb_usb.ini ,没有则建立。工具
四、设备ID 添加到adb_usb.ini 文件。
5.运行命令行
adb kill-server
adb start-server
adb devices
便可查看到设备