appium installation tutorial

[appium] installation tutorial


Open a software in Android through appium.

Environment introduction

  1. Operating System: Windows 10
  2. jdk version: openjdk version “17” 2021-09-14
  3. npm version: 6.14.10
  4. Android sdk version: installer_r24.4.1-windows

Installation process

  1. Java environment construction (it has been installed before, this time will not be described)

  2. nodejs configuration (installed before, not described this time)

  3. Android sdk configuration

  4. app installation

Android sdk configuration

  1. Download the sdk software download address as follows:

  2. After the download is complete, double-click to install.

  3. After the installation is complete, open “SDK Manager.exe” as an administrator and install the necessary tools

Note: If double-clicking “SDK Manager.exe” keeps flashing back, open the tools/android.bat file and modify the content as follows

set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF

//Delete the above content, then add the following content

set java_exe=D:\ java \ 17 \ bin \java.exe
//D:\java\bin\java.exe is the path of java _ _ _

  1. Configure environment variables

//Create a new ANDROID_HOME environment variable
ANDROID_HOME = E:\Android\sdk

//Add the following value to the path variable

  1. Then open cmd. If the execution of adb and aapt is successful, it means that the sdk environment is successfully configured.

app installation

  1. Double-click the installation package to install it directly.

  2. After the installation is complete, open appium, double-click “start server” to start the service. (By default, appium will automatically obtain the paths of Android sdk and java jdk from the system, no configuration is required) The startup is successful, as shown in the following figure:

  3. Click on “start inspector session”. ( Note: Higher versions of appium need to install the inspector separately )

  4. Fill in the configuration file and click “start session”.

   "platformName" : "Android" ,
   "platformVersion" : "5.1.1" , //device system version number 
  "deviceName" : "16a51c2a" , //device name, which can be obtained through adb devices 
  "appPackage" : "com." , //The name of the app to start. Open the app on the phone and use adb shell dumpsys activity|findstr mFocusedActivity to get the appPackage. 
  "appActivity" : ".MainActivity" , //The interface after starting the app. Open the app on the phone, and use adb shell dumpsys activity|findstr mFocusedActivity to get appActivity. 

Note: If the following error message appears, add it in the configuration file "automationName": "UiAutomator1"

An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

  1. Started successfully

Reference link


Leave a Comment

Your email address will not be published. Required fields are marked *