Appium Mobile Automation test environment build Windows-appium-android

Source: Internet
Author: User
Tags install node appium

First step: Install the JDK

Installing the JDK (above version 1.7)

Installation complete Set JDK environment variable (Baidu query)

cmd command, type the java-version command to check if the JDK is installed successfully and set the environment variable successfully, as shown in:

Step Two: Install the Android SDK (software Development Kit for Android)

: http://tools.android-studio.org/index.php/sdk/

As shown in the following:

Download this installation package to unzip in any directory as shown:

After the decompression is complete, the SDK directory such as: D:\ automated test tools \ Automation Test Tool \andrio_sdk\android-sdk-windows added to the environment variable, you must create a variable named Android_home.

As shown in the following:

Click the SDK Manager.exe in the directory to install the tool. Required items are: Android SDK Platform-tools and Android SDK build-tools,android SDK Tools

The image must be installed: Choose an Android version to install (the wavelet is installed as Android5.0.1, if the computer memory is large enough to install all)

GOOGLEFQ must be installed: the options under the Extras folder are all installed

As shown in the following:

After the installation is complete, add the Android_home, tools, Platform-tools, build-tools directories to the environment variable path.

As shown in the following:

After setting the environment variable, we need to find a mobile phone (taking the example of vivo cell phone in wavelet) to turn on the USB debugging mode of the phone, and connect it with the USB interface of the computer via the data cable.

CMD execute adb.dvices command to view connected phone information

As shown in the ADB command, obtain the UDID information for the connected phone:

There are many pits in the construction of wavelets in this environment:

1: Check the data cable is normal

2: Check the USB interface is normal (can be swapped for other USB interface debugging)

3: PC's USB related driver update is up-to-date (can be updated by native installation)

Update the USB-related drivers as shown in the latest:

Go to Computer Management-"Device Management Manager-" Universal Serial Bus Controller, update all USB drivers

Click "Browse my Computer to find driver software R"-click Next to complete the update

5; For some computers do not recognize the Android phone, you need to update the Adb_usb.ini file, you can add the Device Manager of the Android phone vid, pid to the Adb_usb.ini file.

As shown in the following:

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)

As shown in the following:

Note: four-bit value before Pid,vid plus 0x

If the ADB devices 5037 port is not occupied still shows the acquisition failure, when the following error occurred

Workaround:

The first step:

The end of the month should be 5037 port is occupied, a more common error, the execution of the command to see 5037 Port by who occupied:

Netstat-ano | Finder "5037"

But the magical thing happened, and the result is that no program occupies that port.

Step Two:

Then the ADB kill-server, OK, and then execute the ADB start-server, and the same error, the ADB can not start on port 5037.

Step Three:

Execute the ADB nodaemon Server command to see what the situation is, this is a more useful command, in general it will tell us where the problem is

ADB Nodaemon Server

Unfortunately there is still no hint of any error

Fourth Step:

Check environment variable configuration, no errors

Fifth Step:

Basically excluding the ADB itself error, began to locate CreateProcess failure, error 2, this bug, found the error code:

Windows error code 2 Means:2 The system cannot find the file specified. Error_file_not_found
And from the source code this is after a call to CreateProcess () and the file name are given by GetModuleFileName ()

An issue has been verified that is not an environment configuration, so the file cannot be started by locating the system.

Sixth step:

Go to the C:\WINDOWS\System32 directory and check the ADB related files. are all right.

Seventh Step:

Copy the Adb.exe file from the \system32 directory to C:\WINDOWS\SysWOW64, and then execute the ADB devices command again, prompting for the missing AdbWinApi.dll file

Copy the AdbWinApi.dll file from the \system32 directory to C:\WINDOWS\SysWOW64 and execute the ADB devices command successfully.

Step three install node. js

Because node. JS is written by the server side of Appium, node. JS is required first. After installing node. js, you can install Appium directly from NPM

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

As shown in the following:

Download to any directory to install, node. JS installation All the way to the idiot next, note that the path is changed, the installation will automatically add environment variables. That is, you can use the NPM command in any directory under CMD.

After the installation is successful, check that the NPM command is available under CMD

As shown in the following:

Fourth Step: Install Appium server

Install the Appium server, which can be installed by entering NPM install-g Appium under CMD.

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

1: First install CNPM with npm command

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

2: Install Appium again 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

As shown in the following:

Fifth Step install Appium client

Appium Client for capturing location information on app

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

As shown in the following:

Double-click the installation, the desktop will have a appium shortcut after successful installation.

As shown in the following:

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

Next Blog Please pay attention to the wavelet appium automated Test night watchman Environment building!

Appium Mobile Automation test environment build Windows-appium-android

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.