当前位置:网站首页>Win10 installing appium environment

Win10 installing appium environment

2022-06-09 04:19:00 Yu_ monotonously

1 Appium Environmental Science

1.1 install Node.js

Node.js The installation of is relatively simple , Download installation package install ( Installation package node-v16.13.1-x64.msi), Then you can go on with the next step
 Insert picture description here

After installation , Input in the terminal node -v, If the version number is displayed, the installation is successful
 Insert picture description here

1.2 JDK Installation and environment variable configuration

Download installation package , Double click Install Package (jdk-8u333-windows-x64.exe), Then go crazy all the way to the next step
 Insert picture description here
 Insert picture description here

!!! Pay attention to the installation position , The default is C:\Program Files\Java, Try not to modify .
If you want to modify :
First of all : Remember to create a new one under the target path Java Folder , Because after changing the path , It's not automatically created Java Folder .
second : The installation path must be clear , Because the environment variables to be configured later are .
After installation , You need to add environment variables
In turn :
 Insert picture description here

Right click on my computer , Click properties
 Insert picture description here
Click Advanced System Settings
 Insert picture description here
Click environment variable
 Insert picture description here
Click New

Try to click the browse directory to find the variable value , Do not enter manually , Avoid wrong folder name input , Or the path cannot be found due to the wrong path input .
Variable name :JAVA_HOME
A variable's value : Yours jdk Install under directory jdk1.8.0_191 Folder ( The number in the name will vary with the version number ), Try not to enter the variable name manually , It is recommended to click Browse directory , Find the folder , Click ok
 Insert picture description here

Variable name : Fixed write on the picture , A variable's value : To find you JDK The folder after installation , Click OK when finished
 Insert picture description here

Find the name Path Variable name , Click edit
In the following window , Create the following three environment variables , You can paste directly
%JAVA_HOME%\bin
%JAVA_HOME%\lib\tools.jar
%JAVA_HOME%\jre\bin
 Insert picture description here

stay Path Add three environment variables in the , And save exit
Input... At the terminal java and javac, The following screen appears , Description installation successful
 Insert picture description here

1.3 SDK install

1.3.1sdk Introduce

build Android Platforms are not necessary , If you don't want to use it Android If the simulator runs tests, it can skip , however , Proposed installation .
1) Android SDK What tools are provided for us
stay Android SDK Install under directory tools and platform-tools There are some very important tools in the folder , Such as dx,emulator,adb,ddms,aapt etc. . These tools guarantee java The code is compiled and deployed to the simulator .
2) What do these tools do
dx.exe yes Android SDK The compiler , When running Java When you file ,dx.exe Will create a with .dex Postfix file ,Dalvik The virtual machine can recognize and execute the file .

emulator.exe To start Android Simulator .Android The simulator is used in a virtual Android Run your... In the environment Android Applications .

adb.exe be located platform-tools Folder , Developers can use it to install and launch applications on the simulator .

ddms.exe Used to start Android Debugging tools .

aapt.exe For viewing .apk file , Is the disassembly tool for Android programs .
reference :Android SDK brief introduction

1.3.2 sdk install

Download installation package , decompression sdk Installation package (android-sdk_r24.4.1-windows.zip), Unzipped directory , Put it in your own designated position . Remember the location of this directory , And there should be no Chinese in the catalog
 Insert picture description here
 Insert picture description here

Click Run... In the extracted file SDK Manager.exe
explain :
• SDK Manager It's just one. Android Software development kit Manager , It's like a bridge , Connect local and server , Download Android development tools from the server to the local .
 Insert picture description here
 Insert picture description here

The first three must be installed
 Insert picture description here
Google USB Driver Must install
In addition to these four mandatory items , Other automatically checked items , It's OK to install it or not , at will .
 Insert picture description here

Click on the Install 4 packages…
 Insert picture description here

Click to accept , Click on the install
Will download for a while , It's going to be fast
When the download is complete , Yours sdk Under the folder , It should be
 Insert picture description here

After that, you also need to add environment variables , and jdk Same operation , Click New , add to
Variable name :ANDROID_HOME
A variable's value : Yours sdk Install under directory android-sdk Folder , Try not to enter the variable name manually , It is recommended to click Browse directory , Find the folder , Click ok
 Insert picture description here
 Insert picture description here

The attention is to find , It's not new
Add environment variables , It can be copied directly
%ANDROID_HOME%\tools
%ANDROID_HOME%\platform-tools
 Insert picture description here

Add two environment variables
Click OK when finished , Return to the upper menu , Make sure that , preservation
Input... At the terminal adb version
 Insert picture description here

The above information shows that the installation is successful
Use after installation PC End and mobile end use USB Wire connection
When connecting mobile terminal equipment , Input... At the terminal adb devices, When the device information appears, the connection is successful
 Insert picture description here

1.4 install Appium

Download installation package , Unzip the installation package Appium-Server-GUI-windows-1.22.0.zip, Unzip the directory and put it in the specified location , Click on Appium Server GUI.exe To run successfully
 Insert picture description here

When running an automated test program PC The mobile terminal needs to be connected , And keep it appium server Turn on

1.5 install appium-inspector

This step is not required , No installation . If you need to redevelop the automated test program , The tool can be installed for positioning app Elements .
 Insert picture description here

Download installation package , Unzip the installation package directly Appium-Inspector-windows-2022.2.1.zip file , Click on Appium Inspector.exe To run successfully , The premise of operation is to connect the mobile terminal equipment , And start first Appium Server.app Refer to the following contents and screenshots for the operating parameters of , The equipment related information needs to be modified according to the connected mobile terminal equipment :
{
“platformName”: “Android”,
“platformVersion”: “10.0”, # android System version
“deviceName”: “CD2131321312331223”, # equipment id
“appPackage”: “com.test.zzpackage”, # app Package name
“appActivity”: “com.test.zzpackage.Activitys.MainActivity” # app Startup page
}

 Insert picture description here
To get the package name and startup page, you can refer to :
adb View the currently applied package name of the mobile phone , Package name and installation location of all applications
appium Report errors Stderr: ‘Security exception: Permission Denial: starting Intent { act=android.inte… explain

原网站

版权声明
本文为[Yu_ monotonously ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090409540683.html