How to enable adb feature in appium via code?

I am using some adb commands on my appium tests. But to use that, looks like I need to send the flag --relaxed-security or --allow insecure = adb shell.

Could someone let me how I send the parameters via java code?

If you are starting Appium server manually pass --relaxed-security flag while starting Appium server i.e. appium --relaxed-security
or
starting Appium server programmatically
Runtime.getRuntime().exec(“cmd.exe /c start cmd.exe /k “appium --relaxed-security””);
URL u= new URL(“http://0.0.0.0:4723/wd/hub”);

1 Like