Previously wrote a appium for Windows article, because is the 09 T400, the launch of the Android simulator when the crash three times, then the company application for the MacBook Air bar, 15 inch MacBook Pro is too heavy, Also on Mac can really play Appium function, support Android and iOS. Well, not much nonsense, start.
1. Climbing the Wall
Because the subsequent installation process may encounter wall problems, so the first to solve the problem of climbing the wall.
My convenience, the company provides the agent.
2. java
guowenxie-macbookair:~ guowenxie$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
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
Here's the brew installation, brew is an essential Package manager for Mac OS
Execute the following command
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
6. Node
It's convenient to have a brew installation node.
brew install node
7. NPM
guowenxie-macbookair:~ guowenxie$ npm -v
2.0.0-alpha-5
8. Appium
You can now start installing Appium
guowenxie-macbookair:~ guowenxie$ appium -v
1.2.0
9. WD
NPM Install WD
Ten. Xcode and Android SDK
I'm not talking about this.
11. Check the Environment
Appium provides a doctor that runs 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.
Here you can see my Xcode Command line tools is not installed, this handy, Fix it? When you enter Y, you can automatically guide the installation.
Another is the ANDROID_HOME environment variable is not configured well, then we want to configure under.
. bash_profile file
Mac default is not this file, we build a
touch .bash_profile
vi .bash_profile
Open bash_profile file configuration android_home and 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
Okay, run Appium-doctor again.
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
Here, the environment is basically ready.
Finally, if you do not want to install Appium from the command line, you can also install DMG