Skip to main content

Run Command - adb

Description​

This command allows you to run adb commands or other device shell commands. 

You can use the run command to execute adb and shell commands in runtime while executing your test. You can open the settings or wifi settings menu, push a file to SD card, and even call a number.

Parameters​

NameValueDescription
CommandstringCommand to run

This is supported on Android only.

Usage​

info

Replace <server> with the appropriate URL.

Example​

Using Run Command

driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);

...
...

// open android settings
seetest.run("adb shell am start -a android.settings._SETTINGS");


// open wifi settings
seetest.run("adb shell am start -a android.settings.WIFI_SETTINGS");


// push a file to SD storage
seetest.run("adb push C:\\Users\\myuser\\Pictures\\myPicture.png /sdcard/Pictures/myPicture.png");


// call a number
seetest.run("adb shell am start -a android.intent.action.CALL -d tel:+6512345678");