diff --git a/docs/man_pages/project/testing/run-ios.md b/docs/man_pages/project/testing/run-ios.md index b1ac6bc916..2217439c04 100644 --- a/docs/man_pages/project/testing/run-ios.md +++ b/docs/man_pages/project/testing/run-ios.md @@ -45,6 +45,10 @@ Start an emulator with specified device identifier and sdk | `$ tns run ios [--d * `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release). * `--force` - If set, skips the application compatibility checks and forces `npm i` to ensure all dependencies are installed. Otherwise, the command will check the application compatibility with the current CLI version and could fail requiring `tns migrate`. +### Environment Variables + +* `IOS_SIMULATOR_RUN_ARGS` - specifies extra command line arguments to pass to the application when running on the iOS Simulator. E.g. `$ IOS_SIMULATOR_RUN_ARGS=-FIRDebugEnabled ns device run ios`. + <% } %> <% if(isHtml) { %> diff --git a/lib/common/mobile/ios/simulator/ios-simulator-application-manager.ts b/lib/common/mobile/ios/simulator/ios-simulator-application-manager.ts index 46825e13aa..0c5828fdd3 100644 --- a/lib/common/mobile/ios/simulator/ios-simulator-application-manager.ts +++ b/lib/common/mobile/ios/simulator/ios-simulator-application-manager.ts @@ -71,11 +71,14 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase { public async startApplication( appData: Mobile.IStartApplicationData ): Promise { + const args = process.env.IOS_SIMULATOR_RUN_ARGS || ""; const options = appData.waitForDebugger ? { waitForDebugger: true, - args: "--nativescript-debug-brk", + args: `--nativescript-debug-brk ${args}`.trim(), } + : args + ? { args } : {}; await this.setDeviceLogData(appData); const launchResult = await this.iosSim.startApplication(