Appium: Running tests on a device connected to a remote system (uiautomator2)
Architecture:
Here we are running scripts from a remote/local Appium server while the devices are connected to another system in the network.
Setup:
- Start adb server in the system in which devices are connected:
Just run the below command in cmd (given adb is available in path)
adb kill-serveradb -a -P 5037 server nodaemon
Appium capabilities:
Now to run appium tests we need to add the below capability:
Try appium inspector from the remote system with below capability (edit all other fields according to your setup except remoteAdbHost,systemport and adbPort)
here remoteadbhost is the remote system which has connected devices, system port is the uiautomator2 server port which is 8021 by default and finally adbport
This will allow you to inspect the remote devices from your local system
{
“platformName”: “Android”,
“appium:platformVersion”: “11”,
“appium:deviceName”: “sr”,
“appium:app”: “C:\\Users\\Downloads\\ApiDemos-debug.apk”,
“appium:automationName”: “UiAutomator2”,
"remoteAdbHost":"192:168.0.7"…