Skip to main content

Appium local execution - prepare environment

Cloud Server configuration

Enable local appium execution in cloud server configuration file (application.properties) Provide list of supported appium versions. Cloud administrator is responsible to prepare appium environment for each supported appium version on all device host machines.

ct.appium-server.local-execution-enabled=true
ct.appium-server.supported-versions=2.9.0,2.11.1,2.11.3,2.11.4,2.12.1,2.15.0,2.16.2

Device host machine configuration (for online machines)

Install Node

Make sure that latest version of node is installed: Node.js — Download Node.js®

Make sure that node is available in this folder: /usr/local/bin

Install Android Platform Tools

Create folder /Users/Shared/localAppium/android_sdk Download android platform tools from here (for Mac OS): SDK Platform Tools release notes | Android Studio | Android Developers Put platform-tools folder in android_sdk folder, file structure should look like:

Install jq tool

brew install jq

The tool must exist in this location /usr/local/bin/jq Check installation location using

which jq

If installation location is different, for example: /opt/homebrew/bin/jq, then create a symbolic link, using such command:

sudo ln -s /opt/homebrew/bin/jq /usr/local/bin/jq`

Verify that command can be executed, by running:

/usr/local/bin/jq

Chromedrivers

Create folder /Users/Shared/localAppium/chromedrivers Appium server will download the correct chromedriver to this folder automatically. For device host machines without internet access, put all chromedrivers versions that should be supported in this folder. When new chrome version is released, new matching chromedriver version must be added to this folder.

Appium version installation (2.9.0)

Supported Appium versions are 2.9.0, 2.11.1, 2.11.3, 2.11.4, 2.12.1, 2.15.0, 2.16.2 Create folder for each appium version that should be supported, for example: /Users/Shared/localAppium/2.9.0 Create folder /Users/Shared/localAppium/2.9.0/node_modules Install appium server in this folder

cd /Users/Shared/localAppium/2.9.0/node_modules
npm i appium@2.9.0
-- For Appium 2.11.1
npm i appium@2.11.1
-- For Appium 2.11.3
npm i appium@2.11.3
-- For Appium 2.11.4
npm i appium@2.11.4
-- For Appium 2.12.1
npm i appium@2.12.1
-- For Appium 2.15.0
npm i appium@2.15.0
-- For Appium 2.16.2
npm i appium@2.16.2

Install appium drivers for Android and iOS

-- For Appium 2.9.0
cd /Users/Shared/localAppium/2.9.0/node_modules
./appium/index.js driver install uiautomator2@3.5.2
./appium/index.js driver install xcuitest@7.17.4
./appium/index.js driver install espresso@2.40.4
./appium/index.js driver install --source=npm appium-flutter-driver@2.6.0
-- For Appium 2.11.1
cd /Users/Shared/localAppium/2.11.1/node_modules
./appium/index.js driver install uiautomator2@3.7.0
./appium/index.js driver install xcuitest@7.22.1
./appium/index.js driver install espresso@2.44.0
./appium/index.js driver install --source=npm appium-flutter-driver@2.8.0
-- For Appium 2.11.3
cd /Users/Shared/localAppium/2.11.3/node_modules
./appium/index.js driver install uiautomator2@3.7.7
./appium/index.js driver install xcuitest@7.24.15
./appium/index.js driver install espresso@3.3.1
./appium/index.js driver install --source=npm appium-flutter-driver@2.9.2
-- For Appium 2.11.4
cd /Users/Shared/localAppium/2.11.4/node_modules
./appium/index.js driver install uiautomator2@3.8.0
./appium/index.js driver install xcuitest@7.27.0
./appium/index.js driver install espresso@3.5.0
./appium/index.js driver install --source=npm appium-flutter-driver@2.9.2
-- For Appium 2.12.1
cd /Users/Shared/localAppium/2.12.1/node_modules
./appium/index.js driver install uiautomator2@3.8.1
./appium/index.js driver install xcuitest@7.28.3
./appium/index.js driver install espresso@3.5.0
./appium/index.js driver install --source=npm appium-flutter-driver@2.10.0
-- For Appium 2.15.0
cd /Users/Shared/localAppium/2.15.0/node_modules
./appium/index.js driver install uiautomator2@3.9.8
./appium/index.js driver install xcuitest@7.35.1
./appium/index.js driver install espresso@3.5.3
./appium/index.js driver install --source=npm appium-flutter-driver@2.11.0
-- For Appium 2.16.2
cd /Users/Shared/localAppium/2.16.2/node_modules
./appium/index.js driver install uiautomator2@4.1.1
./appium/index.js driver install xcuitest@8.4.0
./appium/index.js driver install espresso@4.1.1
./appium/index.js driver install --source=npm appium-flutter-driver@2.14.1
./appium/index.js driver install --source=npm @axe-devtools/axe-appium-xcuitest-driver@1.2.0
./appium/index.js driver install --source=npm @axe-devtools/axe-appium-uiautomator2-driver@1.3.0
warning

Installing latest version of driver may upgrade appium server version.

Make sure that correct versions of drivers were installed using the following command:

cd /Users/Shared/localAppium/2.9.0/node_modules
./appium/index.js driver list

Download assets

Download the assets for corresponding appium version and unzip to version folder: /Users/Shared/localAppium/2.9.0

After setup for 2 appium versions, file structure should look like:

Restart Device Host Machine

Restart the DHM service after configuration is completed.

Device host machine configuration (for offline machines)

Download the zip bundle from S3

localAppiumBundle.zip Ensure that your bundle includes the following files:

  1. 2.9.0.zip
  2. 2.11.3.zip
  3. jq-macos-arm64
  4. node-v20.17.0-darwin-arm64.tar.gz
  5. platform-tools-latest-darwin.zip
  6. start.sh

Setup Instructions

  1. Unzip the Bundle Extract the contents of the bundle.
  2. Grant Execution Permission Open a Terminal and run: chmod +x start.sh
  3. Run the Setup Script Execute the setup script with superuser privileges: sudo ./start.sh
  4. Completion At the end of the script execution, the DHM will be restarted and operational.

Troubleshooting

In case of errors when installing Appium, run the following command:

npm cache clean --force

Try to close terminal window and reopen it.