diff --git a/docs/en/writing-running-appium/server-args.md b/docs/en/writing-running-appium/server-args.md index 2fdf40496..58a12be16 100644 --- a/docs/en/writing-running-appium/server-args.md +++ b/docs/en/writing-running-appium/server-args.md @@ -92,3 +92,5 @@ All flags are optional, but some are required in conjunction with certain others |`--localizable-strings-dir`|en.lproj|[DEPRECATED] - (IOS-only) the relative path of the dir where Localizable.strings file resides |`--localizable-strings-dir en.lproj`| |`--show-ios-log`|false|[DEPRECATED] - (IOS-only) if set, the iOS system log will be written to the console|| |`--enable-heapdump`|false|Enables NodeJS memory dumps collection feature. This feature is extremely useful for finding memory leaks. Use the 'kill -SIGUSR2 <PID>' command to create a dump of memory heap for _node_ process with the particular PID (this works for *nix systems only). The dump file will be created in the same folder, where main Appium script was executed and will have *.heapsnapshot extension. These snapshot can be then loaded to Chrome Inspector for further investigation. Read the [Rising Stack article](https://blog.risingstack.com/finding-a-memory-leak-in-node-js/) for more details.|| +|`--relaxed-security`|false|Disable additional security checks, so it is possible to use some advanced features, provided +by drivers supporting this option. Only enable it if all the clients are in the trusted network and it is not the case if a client could potentially break out of the session sandbox.|| diff --git a/lib/appium.js b/lib/appium.js index b887b3a19..98b72c0c5 100644 --- a/lib/appium.js +++ b/lib/appium.js @@ -28,7 +28,7 @@ class AppiumDriver extends BaseDriver { // the main Appium Driver has no new command timeout this.newCommandTimeoutMs = 0; - this.args = args; + this.args = Object.assign({}, args); // Access to sessions list must be guarded with a Semaphore, because // it might be changed by other async calls at any time @@ -189,6 +189,10 @@ class AppiumDriver extends BaseDriver { let runningDriversData, otherPendingDriversData; let d = new InnerDriver(this.args); + if (this.args.relaxedSecurityEnabled) { + log.info(`Applying relaxed security to ${InnerDriver.name} as per server command line argument`); + d.relaxedSecurityEnabled = true; + } try { runningDriversData = await this.curSessionDataForDriver(InnerDriver); } catch (e) { diff --git a/lib/parser.js b/lib/parser.js index ba0a1b409..19f473059 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -738,6 +738,18 @@ const deprecatedArgs = [ required: false, help: 'Enable collection of NodeJS memory heap dumps. This is useful for memory leaks lookup', nargs: 0 + }], + + [['--relaxed-security'], { + defaultValue: false, + dest: 'relaxedSecurityEnabled', + action: 'storeTrue', + required: false, + help: 'Disable additional security checks, so it is possible to use some advanced features, provided ' + + 'by drivers supporting this option. Only enable it if all the ' + + 'clients are in the trusted network and it\'s not the case if a client could potentially ' + + 'break out of the session sandbox.', + nargs: 0 }] ];