This is an automated email from the ASF dual-hosted git repository. shazron pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push: new bff9bca CB-13581 open ios simulator by using child_process (#366) bff9bca is described below commit bff9bca81caa7b302b16aad0ec63e125def08ca4 Author: Kenichi Naito <fine1...@gmail.com> AuthorDate: Mon Jul 16 15:42:28 2018 +0900 CB-13581 open ios simulator by using child_process (#366) * open ios simulator by using child_process * remove unnecessary comment --- bin/templates/scripts/cordova/lib/run.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/templates/scripts/cordova/lib/run.js b/bin/templates/scripts/cordova/lib/run.js index 3a6246e..40344a3 100644 --- a/bin/templates/scripts/cordova/lib/run.js +++ b/bin/templates/scripts/cordova/lib/run.js @@ -19,7 +19,7 @@ var Q = require('q'); var path = require('path'); -var iossim = require('ios-sim'); +var cp = require('child_process'); var build = require('./build'); var spawn = require('./spawn'); var check_reqs = require('./check_reqs'); @@ -197,7 +197,15 @@ function deployToSim (appPath, target) { function startSim (appPath, target) { var logPath = path.join(cordovaPath, 'console.log'); - return iossim.launch(appPath, 'com.apple.CoreSimulator.SimDeviceType.' + target, logPath, '--exit'); + return iossimLaunch(appPath, 'com.apple.CoreSimulator.SimDeviceType.' + target, logPath, '--exit'); +} + +function iossimLaunch (app_path, devicetypeid, log, exit) { + var f = path.resolve(path.dirname(require.resolve('ios-sim')), 'bin', 'ios-sim'); + var proc = cp.spawn(f, ['launch', app_path, '--devicetypeid', devicetypeid, '--log', log, exit]); + proc.stdout.on('data', (data) => { + console.log(data.toString()); + }); } function listDevices () { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org