Mobile Automation Test-windows-android-appium environment Construction

Source: Internet
Author: User
Tags install node appium

The first step

Install JDK, this installation step can be ignored if the machine has 1.7 or more versions.

JDK installation package, Baidu download can. Configure environment variables after installation is complete.

CMD under java-version checks if the environment variable is configured successfully.

Step Two

Installing the Android SDK (the Android software Development Kit), testing the Android phone must be to install the Android SDK.

: http://tools.android-studio.org/index.php/sdk/(Download zip version directly, unzip to any directory)

Unzip to any folder, unzip the folder into the environment variable, add environment variables, you must create a variable named Android_home.

Double-click SDK Manager, Optional tool. Must install: Tools folder under Android SDK Platform-tools and Android SDK build-tools,android SDK tools can choose whether to update, recommended Internet speed OK to update directly. Image: Choose a random version, like what version choose what version (I installed Android 5.0.1). GOOGLEFQ installation: All installations under the Extras folder. (Note: To find a place to download FQ, things are more slow.) )

Add the Android_home, tools, Platform-tools, build-tools directories to the PATH environment variable. Save the changes.

%android_home%;%android_home%\tools;%android_home%\platform-tools;%android_home%\build-tools;

When the environment variable is configured, you will need to find an Android phone, connect an Android phone, and turn on the Android phone developer option-usb Debug (Note: Each model of the phone may be different name, similar, to ensure that the phone can connect to the computer. Take the Samsung phone here for example. )

Executed under CMD, ADB devices, the appearance of style is represented by the ADB command, to obtain the Udid connected to the Android phone on the computer.

ADB devices will encounter many pits when acquiring a connected Android phone, where we comb the pits that may be encountered.

1, mobile phone USB debugging must be turned on.

2, find more than two USB cable, to eliminate the problem of the line.

3, more than a few USB interface, troubleshooting USB interface is not good to make problems (such as: 3.0 and 2.0)

4, the driver, through the Device Manager to see whether the installation of drivers or drivers are not up-to-date. (Recommended: Download Driver Wizard, USB-related drivers are updated under.) A special adb Interface will appear after some Android phones are updated. )

5, update Adb_usb.ini files, a few computers do not recognize the Android phone, the Device Manager can be the Android phone under the vid, PID added to the Adb_usb.ini file.

Add vid, pid "_" After the 4-digit number to Adb_usb.ini (Note: Adb_usb.ini default in the C-drive under the current user's home directory. Android directory)

After all these operations have been done in theory, the basic ADB devices will be able to find the Android phone.

For the students who use the Android simulator (this article takes night watchman as an example), there may be a link failure, typically the ADB version of the SDK is inconsistent with the ADB version of the Night gods.

C:\USERS\CZ9025>ADB deviceslist of Devices ATTACHEDADB Server version (doesn ' t match this client (39); Killing...* Daemon started successfully *

Workaround:
1. Close all ADB processes first;
2, the computer in the SDK directory Adb.exe files, copied to the Night God Simulator directory (Bin directory), night God Simulator directory under the original ADB file name is called Nox_adb.exe, copy the past renamed to Nox_adb.exe, replace can.
3. Restart Simulator

Then go to the Command Line window, enter the ADB devices to view, you can display the device information.

C:\USERS\CHENSHIFENG>ADB deviceslist of Devices attached127.0.0.1:62001 device

or run the cmd command, CD to the night God installation directory, execute the command "Nox_adb.exe connect 127.0.0.1:62001";

Step Three

Installing node. js, because the server side of Appium was written by node. js, you need to install node. JS first. After installing node. js, you can install Appium directly from NPM. (Note: NPM is similar to a Python pip, an unofficial package manager)

official:https://nodejs.org/en/download/

Download different versions of node. JS based on your operating system

node. JS installs all the way to the idiot next, notice that the path is changed, and the environment variable is added automatically when the installation is successful. That is, you can use the NPM command in any directory under CMD.

After the installation is successful, it detects if NPM is available, although the environment variables are added to the path directly during the installation, but what if not. So develop the habit of checking the environment.

Fourth Step

Install the Appium server, which can be installed by entering NPM install-g Appium under CMD. (The installation process is slow, please wait patiently)

If NPM install-g Appium is extremely slow and cannot be downloaded, you can use the internal image npm--registry http://registry.cnpmjs.org install-g appium

Install if failure can attempt to install Appium via CNPM

Installing CNPM with npm command

NPM install-g cnpm--registry=https://registry.npm.taobao.org

Installing Appium via CNPM

CNPM install-g Appium--no-cache

After the installation is successful, view the current Appium version via Appium-v, and directly enter Appium to start the Appium server side.

If you are still unable to download the Appium server, you can only load the appropriate Appium version of the operating system on the Appium official website.

We can download the corresponding Appium version of the operating system on the Appium official website.

https://bitbucket.org/appium/appium.app/downloads/

Currently the latest version is Appiumforwindows_1_4_16_1.zip , note that this is a Windows version and if your PC is for Mac please download appium-1.5.3.dmg . Although you have seen these downloads, I do not guarantee that you can download them down.

So, to provide a link to download the Baidu network disk: Https://pan.baidu.com/s/1pKMwdfX

Let's take Windows as an example, unzip the downloaded appiumforwindows.zip and click appium-installer.exe to install it.

According to the prompt, step by step installation, here no longer verbose. Eventually generate the appium icon on the desktop, double-click Start, the Appium server interface is as follows.

The Appium-server is ready to open. As for the use of appium we put it in the later chapters to introduce.

Finally, open the Windows command prompt, enter the "appium-doctor" command, and if you get the following prompt, the environment you appium is ready to complete.

Note: If you are prompted:"Appium-doctor" is not an internal or external command , locate the Appium installation directory, for example:

C:\Program Files\appium\node_modules\.bin

Add to the environment variable path below (refer to the settings for the Java environment).

Fifth Step

Installs the Appium client, which is used to crawl location information on the app.

Address: https://github.com/appium/appium-desktop/releases/tag/v1.2.1

Double-click the installation, after successful installation, there will be a appium shortcut to the left.

Here you may encounter cannot download the question, truthfully in the download not down, can leave a message, I will share to you a Baidu network disk download link.

All the environments that windows-android-appium here have been built.

Sixth step

Installing Appium-python-client

1. Before the Python environment is installed, the PIP is ready, so just open cmd here, enter: Pip install appium-python-client

Ps:appium environment installation is more complex, please maintain peace of mind to install, please maintain peace of mind to install, please maintain peace of mind to install ~ ~ ~

Please leave a message if you have questions ~ ~

Mobile Automation Test-windows-android-appium environment Construction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.