How to execute ADB Shell commands in katalon studio

Hi All,

While working with Android mobile devices I need to send few “adb shell” command calls to device for example turn off mobile wifi, and turn on wifi, few of other intents to popup, So in katatlon studio this feature is not supporting mean i did’t see any classes for this but this feature was there in internal SDK(for developing the kaalon Studio “com.kms.katalon.execution.mobile_1.0.0.201808300639.jar” this jar was in root path of katalon where we installed) it’s not directly providing this feature from user level packages.

Internal SDK Method:

private String initAndroidDeviceManufacturer()
throws IOException, InterruptedException, AndroidSetupException
{
String getManuFacturerCommand = { getADBPath(), “-s”, this.deviceId, “shell”, “getprop”,
“ro.product.manufacturer” };
return ConsoleCommandExecutor.runConsoleCommandAndCollectFirstResult(getManuFacturerCommand);
}

Is there any way to solve this problem from katalon instead of making new user-defined class methods with ProcessBuilder like below.

ADBParentPath = ADBToolPath.getParent() + “/”;
_builder = new ProcessBuilder(“/bin/sh”, “-c”, “cd \”" + ADBParentPath + “\”; " + command);
_proc = _builder.start();

Thanks!
~Siri Kumar

2 Likes

Did you get any answers for that?