1. 首页
  2. 文档
  3. Mobile phone automatic connection environment configuration

白皮书下载

实在智能Agent产品白皮书(7.2.0).pdf

Mobile phone automatic connection environment configuration

发刊日期:
2021/10/15

编辑团队:
实在学院

Part 1 PC side environment configuration

To realize mobile phone automation, the following software needs to be installed in Windows system:

  1. Java Development Kit
  2. Android SDK
  3. Appium

The installation steps of several software are described below.

1、 Install the java development kit (JDK)

1.1 installation

Download the installation package for JDK 8.

Please inhttps://www.oracle.com/cn/java/technologies/javase/javase-jdk8-downloads.html Select the corresponding installation package according to the version and system type of the local system.

After downloading, install in the default location. Restart the computer after installation. The installation diagram is as follows:

1.2 adding environment variables

  1. Open & ldquo; This computer & rdquo; Right click in the blank of the page and select properties to open about. Click Advanced system settings and click environment variables in the pop-up window. As shown in the figure below:

2. Select path in the system variable and click & ldquo; Edit & rdquo;. In the & ldquo; Edit environment variable & rdquo; In the pop-up window of, click new to create a new variable:% Java_ Home% \ bin, click [OK] to finish adding variables.

1.3 verify whether the Java environment is successfully installed

1. Enter & ldquo; in the search box next to the [start] button; cmd” Or & ldquo; Command prompt & rdquo;, Open the searched app.

2. Enter Java verison at the command prompt and click enter. If the installation is successful, the system will display the currently installed java version.

2、 Install Android SDK

2.1 installing Android Stdio

1. Download the installation package of Android studio (download link: https://developer.android.google.cn/studio?hl=zh -cn#downloads)。

Install in the default location. The installation diagram is as follows:

2. Save to the default path.

2.1 installing Android SDK

1. Open Android studio and click file - & gt; Settings, search & ldquo; directly in the settings pop-up box; SDK”, Select Android SDK.

2. Click & ldquo; Edit” Button to select the SDK installation path.

3. Select the version to be installed from the list in the SDK below (it is recommended to install version 4.3 or above).

4. Check & ldquo; Accept”, Click [next].

5. Click [OK], check the contents to be installed again, and click [next].

6. After installation, the window will display & ldquo; Android SDK is up to date”, As shown in the figure below. Click Finish to close the window.

2.2 adding environment variables

  1. Open & ldquo; This computer & rdquo; Right click in the blank area of the page and select properties to open system. Click Advanced system settings and click environment variables in the pop-up window. As shown in the figure below:

2. Select path in the system variable and click & ldquo; Edit & rdquo;. In the & ldquo; Edit environment variable & rdquo; In the pop-up window, click new to create a new variable:% Android_ Home% \ platform tools and% Android_ Home% \ tools, click [OK] to finish adding variables. As shown in the figure below:

2.3 verify whether the Android environment is successfully installed

Enter & ldquo; in the search box next to the start button; cmd” Or & ldquo; Command prompt & rdquo;, Open the searched app. Enter ADB version at the command prompt and click enter. If the installation is successful, the system will display the currently installed Android debug bridge version.

⚠ Note: if the user installs the Android SDK outside the system disk, an additional environment variable needs to be added. Add as follows:

1. Search for ADB in the folder under the Android installation path,

2. Right click the file and select properties,

3. Copy the file location and add the path to the environment variable.

3、 Install appium

3.1 installing appium application

Download appium's installation package( http://appium.io/downloads.html )。 Install in the default location. The installation diagram is as follows:

3.2 setting appium

1. Start appium, set the host address to 127.0.0.1, and keep the default port number 4723.

2. Click Edit configurations in the above figure to fill in the installation addresses of JDK and Android SDK respectively.

3. After restarting, click Start server to start appium.

4. After successful startup, as shown in the figure below:

 

Part 2 mobile terminal environment configuration

1、 Real machine connection

1. After connecting the mobile phone through USB, you need to turn on the USB debugging switch on the physical mobile phone. Click new session window under file in appium.

 

2. Open the following window and add devicename and platformname variables to desired capabilities.

-Devicename: enter the command ADB device & ndash; on the CMD command line; l , view the name of the physical phone, and then set devicename to the name of the physical phone.

-Platform name: fill in Android.

three After filling in, click start session to connect normally, and the following interface is displayed, indicating that the environment has been configured.

 

IIConnect via simulator

2.1 install and configure the mobile phone simulator

Here & ldquo; Nocturnal simulator & rdquo; For example.

1. Download the installation package of nocturnal simulator. (download address: https://www.yeshen.com/ )Install in the default location. The installation diagram is as follows:

2. Copy adb.exe under Android \ Android SDK \ platform tools and rename NOx_ adb.exe。

3. Replace the file under NOx \ bin.

2.2 connecting the simulator

1. After opening the nocturnal simulator installed in the previous step, click [new session window] under [file] in appium.

two Open the following window and add two variables devicename and platformname in desired capabilities.

-Devicename: when connecting to the simulator for testing, you need to set the address of the night God simulator in the devicename in the figure below (the default address of the night God simulator is 127.0.0.1:62001).

-Platform name: fill in Android.

 

3. After filling in, click [start session] to connect normally, and the following interface is displayed, indicating that the environment has been configured.

 

企业培训
技术支持
加入社群
公众号
实在智能Agent学习群
扫码关注微信公众号