Appium 環境搭建 - macOS
阿新 • • 發佈:2017-07-31
file 文件 pan fss con 環境 ont rec 自己 export
本文沒有安裝 Appium Desktop,Appium Server 直接在命令行中進行即可。
- Homebrew,macOS 包管理器: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 。
- Carthage,appium-doctor 會檢查這一項: brew install carthage 。
- node & npm,nodejs: brew install node 。
- appium:npm install -g appium,推薦使用淘寶鏡像 npm --registry http://
- 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
- 執行 .bash_profile,使環境變量生效: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
Appium 環境搭建 - macOS