來源:http://www.infoshare.cc
1、下載appium之前命令行檢查
$ java -version java version "1.8.0_71" Java(TM) SE Runtime Environment (build 1.8.0_71-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
$ brew -v Homebrew 0.9.9 (git revision 1158; last commit 2016-07-20) Homebrew/homebrew-core (git revision 666b; last commit 2016-07-20) $ node -v v6.3.0
如果brew和node未安裝:
a.安裝brew命令
$ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
b.安裝node命令
$brew install node
2、安裝Appium
a.給予local文件可讀可寫可執行權限
$sudo chmod -R 777 /usr/local
b.非root權限下安裝Appium
$npm install -g appium
c.安裝Appium Client
$git clone https://github.com/appium/python-client.git $cd python-client/ $sudo python setup.py install
d.安裝appium-doctor(已經安裝的用戶可忽略)
$ appium-doctor -bash: appium-doctor: command not found superFangfang:python-client macbook$ npm install appium-doctor -g
e.安裝appium.dmg客戶端
下載鏈接地址:https://bitbucket.org/appium/appium.app/downloads/
3.檢查Appium成功安裝
$ appium-doctor info AppiumDoctor ### Diagnostic starting ### info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer WARN AppiumDoctor ✖ Xcode Command Line Tools are NOT installed! info AppiumDoctor ✔ DevToolsSecurity is enabled. info AppiumDoctor ✔ The Authorization DB is set up properly. info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node info AppiumDoctor ✔ HOME is set to: /Users/macbook WARN AppiumDoctor ✖ ANDROID_HOME is NOT set! WARN AppiumDoctor ✖ JAVA_HOME is set to '/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home' but this is NOT a valid path! WARN AppiumDoctor ✖ adb could not be found because ANDROID_HOME is NOT set! WARN AppiumDoctor ✖ android could not be found because ANDROID_HOME is NOT set! WARN AppiumDoctor ✖ emulator could not be found because ANDROID_HOME is NOT set! info AppiumDoctor ### Diagnostic completed, 6 fixes needed. ### info AppiumDoctor info AppiumDoctor ### Manual Fixes Needed ### info AppiumDoctor The configuration cannot be automatically fixed, please do the following first: WARN AppiumDoctor - Manually configure ANDROID_HOME. WARN AppiumDoctor - Manually configure JAVA_HOME. WARN AppiumDoctor - Manually configure ANDROID_HOME and run appium-doctor again. info AppiumDoctor ### info AppiumDoctor info AppiumDoctor Bye, run appium-doctor again when all manual fixes have been applied! info AppiumDoctor
以上有部分軟件未安裝,接下來彌補上。
a.Xcode Command Line Tools
$ xcode-select --install xcode-select: note: install requested for command line developer tools
b.Android SDK
下載地址:https://developer.android.com/studio/install.html
下載完成之后,安裝網上步驟一步一步安裝並下載完SDK成之后,配置環境變量
# vim /etc/profile export ANDROID_HOME=/Users/macbook/Library/Android/sdk export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/platform-tools
c.網上下載java安裝后,配置環境變量
# vim /etc/profile export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
再次檢查Appium成功安裝
$ appium-doctor info AppiumDoctor ### Diagnostic starting ### info AppiumDoctor ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer info AppiumDoctor ✔ Xcode Command Line Tools are installed. info AppiumDoctor ✔ DevToolsSecurity is enabled. info AppiumDoctor ✔ The Authorization DB is set up properly. info AppiumDoctor ✔ The Node.js binary was found at: /usr/local/bin/node info AppiumDoctor ✔ HOME is set to: /Users/macbook info AppiumDoctor ✔ ANDROID_HOME is set to: /Users/macbook/Library/Android/sdk info AppiumDoctor ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home info AppiumDoctor ✔ adb exists at: /Users/macbook/Library/Android/sdk/platform-tools/adb info AppiumDoctor ✔ android exists at: /Users/macbook/Library/Android/sdk/tools/android info AppiumDoctor ✔ emulator exists at: /Users/macbook/Library/Android/sdk/tools/emulator info AppiumDoctor ### Diagnostic completed, no fix needed. ### info AppiumDoctor info AppiumDoctor Everything looks good, bye! info AppiumDoctor