mac 安装配置appnium环境

前提:假设你能够访问guge

0. 下载appium

进入网站:https://github.com/appium/appium-desktop/releases/tag/v1.13.0,下载对应系统的appium,如:Appium-1.13.0-mac.zip,解压,运行启动

1. 下载Android SDK packages:

进入网站:https://developer.android.google.cn/studio?hl=zh_cn,往下拖动,下载 sdk-tools-darwin-4333796.zip(windows系统下载 sdk-tools-windows-4333796.zip)

2. 建立目录结构

新建androidsdk(名字任意,不是必须这个名字)文件夹,将上一步的zip包解压到该文件夹下,此时文件结构为:androidsdk/tools/...

3. cd 进入tools/bin/目录下,执行如下命令:

sdkmanager "platform-tools" "platforms;android-28" "build-tools;28.0.2"

当看到如下100%字样,表示安装成功,如果到了诸如11%就停止了,需要重新执行命令

January 16, 2019
---------------------------------------
Accept? (y/N): y
[=======================================] 100% Unzipping... android-9/zipalign

完成后,目录结构如下:

.
├── build-tools
│   └── 28.0.2
├── licenses
│   └── android-sdk-license
├── platform-tools
│   ├── NOTICE.txt
│   ├── adb
│   ├── api
│   ├── deployagent
│   ├── deployagent.jar
│   ├── deploypatchgenerator.jar
│   ├── dmtracedump
│   ├── e2fsdroid
│   ├── etc1tool
│   ├── fastboot
│   ├── hprof-conv
│   ├── lib64
│   ├── make_f2fs
│   ├── mke2fs
│   ├── mke2fs.conf
│   ├── package.xml
│   ├── sload_f2fs
│   ├── source.properties
│   ├── sqlite3
│   └── systrace
├── platforms
│   └── android-28
└── tools
    ├── NOTICE.txt
    ├── android
    ├── bin
    ├── emulator
    ├── emulator-check
    ├── lib
    ├── mksdcard
    ├── monitor
    ├── proguard
    ├── source.properties
    └── support

4. 配置环境变量:

# 添加
ANDROID_HOME=/Applications/Coding/androidsdk
# path中添加
$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/28.0.2
# 添加
export ANDROID_HOME

执行命令使之生效:source ~/.bash_profile

5. 安卓手机开启USB调试模式,手机通过数据线连接电脑

6. 执行命令adb devices -l

$ adb devices -l
List of devices attached
97a1de2f               device usb:336573696X product:odin model:OD105 device:odin transport_id:3

7. 配置完成,使用程序测试

你可能感兴趣的:(appnium,selenium)