https://www.cnblogs.com/feng-20/p/14130800.html
https://testerhome.com/topics/1225
https://www.sohu.com/a/270432827_470023
https://blog.csdn.net/rongyu3220/article/details/86609534
https://www.jianshu.com/p/ec4c5de13c58?utm_campaign=hugo
配置通过后链接手机,输入手机lists 可以看到自己手机,则结束 cd application/appium
http://www.python3.vip/tut/auto/appium/01/
https://blog.csdn.net/rongyu3220/article/details/86609534 安装wd啊 安装doctor
javahome配置https://www.cnblogs.com/syw20170419/p/8902033.html
https://blog.csdn.net/watch_the_sunset/article/details/106603941
测试小白从零开始搭建,摸索+配置,大概用了一天的时间,最后mac电脑连接手机,查看到手机型号的时候,还是很开心的~在此分享相关的一切必要信息。
分成两部分,Selenium是python的一个包,所以第一部分是python相关配置;
第二部分就是安卓部分的的相关配置;
第一篇
第二篇 安卓相关配置
1. 爬墙
因为后续安装过程中可能会碰到墙的问题,所以首先得解决爬墙的问题。
我的方便,公司提供代理。
2. java
查看系统java版本,java是系统自带:
命令行输入:java -version
3.java jdk
如果没有,则需要安装java jdk
javajdk下载地址:
https://www.oracle.com/java/technologies/javase-jdk15-downloads.html
家庭网络基本都无法现在,后续是通过电脑连接5G网络下载下来的,暂时把15.0.1的版本放在了百度网盘上:
链接: https://pan.baidu.com/s/1DJmKVBge0dpmmzaXd6DM2Q 密码: 9r5j
下载成功后,傻瓜安装即可:
4.java sdk
官网下载,下载对应系统的,下载后解压在本地相关文件夹下,我偷懒直接放在download下了;
https://www.oracle.com/java/technologies/javase-downloads.html
解压后的安装步骤,
先在tools文件夹找到 android,按住control并单击打开应用程序;
也可以通过命令行打开它:
cd 进入tools文件夹 并输入./Android sdk
打开后的界面,选择前面三项,并点击右下角安装这三项;
跳转页面后,选择接受文档,并安装;
重新进入tools-android看到三项都安装成功,即可。
6.环境变量的配置;
5.下载appium
可以通过命令行安装 但是一直无法成功,我最后还是选择官网下载dmg;
3. git
guowenxie-macbookair:~ guowenxie$ git --version
git version 1.8.5.2 (Apple Git-48)
4. ruby
guowenxie-macbookair:~ guowenxie$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
5. brew
guowenxie-macbookair:~ guowenxie$ brew -v
Homebrew 0.9.5
这边提下brew的安装,brew是Mac OS不可或缺的套件管理器
执行下面命令
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
6. node
有了brew安装node就方便了
brew install node
7. npm
guowenxie-macbookair:~ guowenxie$ npm -v
2.0.0-alpha-5
8. Appium
现在可以开始安装Appium
guowenxie-macbookair:~ guowenxie$ appium -v
1.2.0
9. wd
npm install wd
10. Xcode和Android SDK
这个不说了
11. 检查环境
Appium提供了一个doctor,运行appium-doctor
guowenxie-macbookair:~ guowenxie$ appium-doctor
Running iOS Checks
✔ Xcode is installed at /Applications/Xcode.app/Contents/Developer
✖ Xcode Command Line Tools are NOT installed: Error: Command failed: No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
Fix it? (y/n) y
Press any key to continue:
✔ Xcode Command Line Tools are installed.
✔ DevToolsSecurity is enabled.
✔ The Authorization DB is set up properly.
✔ Node binary found at /usr/local/bin/node
✔ iOS Checks were successful.
Running Android Checks
✖ ANDROID_HOME is set but does not exist on the file system at "Users/guowenxie/Documents/adt-bundle_mac-x86_64-20140702/sdk"
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.
这里可以看到我Xcode Command Line Tools没有安装,这个方便,Fix it?的时候输入Y,就能自动导向安装了。
另一个是ANDROID_HOME的环境变量没配置好,那么我们要配置下。
12. bash_profile文件
Mac 默认是没有这个文件的,我们自己建一个
touch .bash_profile
vi .bash_profile
打开bash_profile文件配置ANDROID_HOME和JAVA_HOME
export ANDROID_HOME="/Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk"
export JAVA_HOME=$(/usr/libexec/java_home)
source .bash_profile
好了,再次运行appium-doctor
guowenxie-macbookair:~ guowenxie$ appium-doctor
Running iOS Checks
✔ Xcode is installed at /Applications/Xcode.app/Contents/Developer
✔ Xcode Command Line Tools are installed.
✔ DevToolsSecurity is enabled.
✔ The Authorization DB is set up properly.
✔ Node binary found at /usr/local/bin/node
✔ iOS Checks were successful.
Running Android Checks
✔ ANDROID_HOME is set to "/Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk"
✔ JAVA_HOME is set to "/usr/libexec/java_home."
✔ ADB exists at /Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb
✔ Android exists at /Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/android
✔ Emulator exists at /Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/emulator
✔ Android Checks were successful.
✔ All Checks were successful
到此,环境基本准备好了。
最后,如果不想通过命令行安装Appium,也可以安装dmg