How can we start the Appium server with custom command-line arguments (IE --relaxed-security)

How can we start the Appium server with custom command-line arguments (IE --relaxed-security)? We need this to be able to execute shell commands on the device to simulate actions other applications would perform that our application requires.

For example, we need to open a link (from email) on the mobile device with the default browser, but the link doesn’t actually open the browser, it registers the device and returns the user to the application. From ADB, I can accomplish this with ‘adb
shell am start -a android.intent.action.VIEW -d “https://…”’. It is working in Katalon based off of this article: Android shell - appium. Except that we get the Security Exception and need to set the --relaxed-security argument when starting the Appium server.

This is the code I am attempting to get working:

AppiumDriver driver = AppiumDriverManager.getDriver()

Map<String, Object> args = new HashMap<>()

args.put(“command”, “am”)

args.put(“args”, [‘start’, ‘-a android.intent.action.VIEW’, ‘-d "’ + url + ‘"’])

driver.executeScript(‘mobile: shell’, args)

Hi community !

I would like to know how to start Appium server with custom command-line arguments as well.
Can anyone help me please ?

I’m curious if anyone has figured out how to do this too.

1 Like

Do we have solution to this problem yet?