本文没有安装 Appium Desktop,Appium Server 直接在命令行中进行即可。
- Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Carthage appium-doctor会检查这一项
brew install carthage
- node
brew install node
- appium
npm install -g appium,推荐使用淘宝镜像:npm --registry http://registry.npm.taobao.org install -g appium
- wd
npm --registry http://registry.npm.taobao.org install -g wd
- appium-doctor
npm --registry http://registry.npm.taobao.org install -g appium-doctor
- Xcode
App Store上安装时一直转圈,网上找到两种解决方案:一更改 DNS 为114.114.114.114,无效;二是去苹果开发中心下载 Xcode 安装包,一直在官网没找到/(ㄒoㄒ)/~~。发现自己 App Store中 macOS Sierra 需要更新,更新完成后重启电脑,再在 App Store 中下载 Xcode,可以了。 - Android SDK
Android Studio 中文社区有提供独立安装包 - 环境变量配置
- 新建 ~/.bash_profile 文件
touch ~/.bash_profile
- 在~/.bash_profile文件写入一下内容
export ANDROID_HOME="/usr/local/bin/android-sdk"
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$PATH:$JAVA_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
source ~/.bash_profile
- 检查配置环境
➜ ~ appium-doctor
info AppiumDoctor Appium Doctor v.1.4.3
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ Node version is 8.2.1
info AppiumDoctor ✔ Xcode is installed at: /Library/Developer/CommandLineTools
info AppiumDoctor ✔ Xcode Command Line Tools are installed.
info AppiumDoctor ✔ DevToolsSecurity is enabled.
info AppiumDoctor ✔ The Authorization DB is set up properly.
info AppiumDoctor ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor ✔ HOME is set to: /Users/yufei
info AppiumDoctor ✔ ANDROID_HOME is set to: /usr/local/bin/android-sdk
info AppiumDoctor ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home
info AppiumDoctor ✔ adb exists at: /usr/local/bin/android-sdk/platform-tools/adb
info AppiumDoctor ✔ android exists at: /usr/local/bin/android-sdk/tools/android
info AppiumDoctor ✔ emulator exists at: /usr/local/bin/android-sdk/tools/emulator
info AppiumDoctor ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor