Some time ago studied the Appium installation, although the Appium official website provides the steps is very simple, but still in the configuration process stepped a lot of pits. So it is necessary to record my installation steps on Mac computer, to help you avoid into the pit.
The following is the complete process for installing Appium, including the installation of the Environment for Mac platforms, and the installation of Appium.
0. Mac platform Base Environment
Make sure the Mac platform already has the following software. Install the Appium again.
1.java
java-version
java Version "1.8.0_66"
Java (TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot (TM) 64-bit Server VM (build 25.66-b17, mixed mode)
2. Brew
brew-v
homebrew 0.9.9 (git revision f1293; last commit 2016-05-30)
3.Xcode
Testing the iOS app is required.
Open the Finder, and under the Applications folder, see if there is a Xcode.app program. If not, you need to install it.
: https://developer.apple.com/downloads/
The installation method is the same as for all DMG packages.
4.Android SDK
Test Android app required.
: Https://developer.android.com/studio/index.html#downloads
Select: Android-sdk_r24.4.1-macosx.zip (the latest version at the time of this writing) is decompressed to any location, such as/USR/LOCAL/ANDROID-SDK-MACOSX.
Run/usr/local/android-sdk-macosx/tools/android to launch the Android SDK Manager. 1.
Figure 1:
650) this.width=650; "src=" http://img.blog.csdn.net/20160601102612456 "title=" here write a picture describing "style=" margin:0px;padding:0 px;border:none;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline; "Alt=" 20160601102612456 "/>
You can download and update the Android SDK tolls and Android SDK Platform-tools here. To keep the default options, click Install Packages .... Go to Figure 2.
Figure 2:
650) this.width=650; "src=" http://img.blog.csdn.net/20160601102758911 "title=" here write a picture describing "style=" margin:0px;padding:0 px;border:none;font-weight:inherit;font-style:inherit;font-family:inherit;vertical-align:baseline; "Alt=" 20160601102758911 "/>
Accept License. Then the install will be ready. Depending on the speed of the network, it may take up to 10-20 minutes for the process to wait patiently.
7. Setting Environment variables
Add the following two lines in the ~/.bash_profile. After execution: Source ~/.bash_profile makes the environment variable effective.
Export java_home=$ (/usr/libexec/java_home)
Export ANDROID_HOME=/USR/LOCAL/ANDROID-SDK-MACOSX
At this point, the Mac platform required to install Appium has been configured. Next, start installing Appium.
1, Appium Installation
Once the Mac platform environment is installed, you can start installing Appium.
There are two ways to build a appium environment under Mac:
1. Direct Download APPIUM.DMG Run
2. Installing with NPM
Download DMG Package installation method, very simple, and install all the DMG package. Not a lot of introductions. The following is a main introduction to the method of installation via NPM. It is not recommended to use sudo permissions to install Appium, which can cause inexplicable problems during the installation process.
The steps provided on the official website are as follows:
Brew Install node # get node. js
npm install-g appium # get Appium
NPM Install WD # get Appium client
Appium & # Start Appium
node Your-appium-test.js
I also follow this step.
1. Install node. js
Appium relies on the node. JS environment, so the node environment needs to be installed first. The installation method is to execute the Brew install node.
After the installation is complete, you can perform node-v to view the node version.
Node-v
v6.2.0
Keng:
Upgrade Homebrew:brew update first to be able to install the latest version of node. The first time I installed it was because there was no upgrade to brew, so the node version installed through the Brew install node was low, resulting in a NPM installation of the Appium hint "' appnium ' isn't in the NPM registry."
2. Installing Appium Server
Enter NPM install-g Appium at the terminal. (Do not use sudo, do not use sudo, do not use sudo)
This process can be slow.
3. Installing Appium Client
Enter NPM install WD at the terminal.
2. Check the Environment
Appium Doctor is used to appium the successful installation (requires a separate installation). Download Appium doctor's URL in: Https://github.com/appium/appium-doctor
Perform NPM install appium-doctor-g at the terminal to mount the doctor.
When the installation is complete, the terminal input Appium-doctor detects if the environment is successful.
Appiun-doctor
The output information, like the following, is all a check mark, indicating that the environment was installed successfully.
Info Appiumdoctor # # Diagnostic Starting # # #
Info Appiumdoctor Xcode is installed at:/applications/xcode.app/contents/developer
Info appiumdoctor Xcode Command line Tools is 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/liuchunming
Info Appiumdoctor Android_home is set to:/USR/LOCAL/ANDROID-SDK-MACOSX
Info Appiumdoctor Java_home is set to:/library/java/javavirtualmachines/jdk1.8.0_66.jdk/contents/home
Info appiumdoctor adb exists at:/usr/local/android-sdk-macosx/platform-tools/adb
Info appiumdoctor Android exists at:/usr/local/android-sdk-macosx/tools/android
Info appiumdoctor emulator exists at:/usr/local/android-sdk-macosx/tools/emulator
Info Appiumdoctor # # Diagnostic completed, no fix needed. ###
Info Appiumdoctor
Info appiumdoctor Everything looks good, bye!
Info Appiumdoctor
3. Start Appium
Enter Appium & in terminal.
Appium &
[1] 12649
liuchunmings-macbook-pro:~ liuchunming$ [Appium] Welcome to Appium v1.5.2 (REV F12932CF3176FFEA5F4004984A390E8DC929EBBF)
[Appium] Appium REST HTTP Interface listener started on 0.0.0.0:4723
At this point, the Appium installation is complete.
Configuring the Appium development environment