Skip to content

Commit

Permalink
[TIMOB-18633] Adding args for launching WatchKit apps
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalter committed Apr 17, 2015
1 parent a586825 commit 5538c3f
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions lib/simulator.js
Expand Up @@ -410,13 +410,31 @@ function launch(udid, options, callback) {
var existingCrashes = getCrashes(),
timeout = Math.max(options.timeout || 180, 1), // default of 180 seconds, minimum of 1 seconds
args = simHandle.cmd.slice(1).map(function (p) {
return p === '<app path>' ? (options.appPath || '') : p;
}).concat('--timeout', isNaN(timeout) ? 180 : timeout),
simProcess = spawn(simHandle.cmd[0], args),
return p === '<app path>' ? (options.appPath || '') : p;
}).concat('--timeout', isNaN(timeout) ? 180 : timeout),
simProcess,
appName = options.appName || (options.appPath ? path.basename(options.appPath) : null),
findLogTimer = null,
tail;

if (options.launchWatchApp) {
args = args.concat(['--launch-watch-app']);
}
if (options.launchBundleId) {
args = args.concat(['--launch-bundle-id', options.launchBundleId]);
}
if (options.externalDisplayType) {
args = args.concat(['--external-display-type', options.externalDisplayType]);
}
if (options.watchLaunchMode) {
args = args.concat(['--watch-launch-mode', options.watchLaunchMode]);
}
if (options.watchNotificationPayload) {
args = args.concat(['--watch-notification-payload', options.watchNotificationPayload]);
}

simProcess = spawn(simHandle.cmd[0], args),

emitter.emit('log-debug', __('Executing: %s', simHandle.cmd[0] + ' "' + args.map(function (a) { return a && typeof a === 'string' ? a.replace(/ /g, '\ ') : a; }).join('" "') + '"'));

// listen for ios-sim output
Expand Down

0 comments on commit 5538c3f

Please sign in to comment.