You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/06/12 02:40:56 UTC
[GitHub] knight9999 opened a new pull request #366: CB-13581 open ios
simulator by using child_process
knight9999 opened a new pull request #366: CB-13581 open ios simulator by using child_process
URL: https://github.com/apache/cordova-ios/pull/366
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist
is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
### Platforms affected
cordova-ios
### What does this PR do?
The command `cordova run ios --simulator` does not finish properly.
Because bin/templates/scripts/cordova/lib/run.js opens ios simulator by calling
```
iossim.launch(appPath, 'com.apple.CoreSimulator.SimDeviceType.' + target, logPath, '--exit');
```
Dut to the last argument `--exit`, ios-sim module will call `process.exit(0);` in ios-sim/src/lib.js.
Then the cordova command itself stops.
This PR improves the issue.
By using child_process, the cordova command does not stop when ios-sim calls `process.exit(0)`.
### What testing has been done on this change?
Here is sample plugin. https://github.com/knight9999/cordova-plugin-promise-sample .
This plugin has a `after run` plugin hook.
This plugin shows following messages after the command `cordova run ios --emulator`.
```
--- start run ---
--- now count = 0 ---
--- now count = 1 ---
--- now count = 2 ---
--- now count = 3 ---
--- now count = 4 ---
--- now count = 5 ---
--- now count = 6 ---
--- now count = 7 ---
--- now count = 8 ---
--- now count = 9 ---
```
Before applying this PR, only the first message is shown. Because the cordova command stops due to the `process.exit(0)`.
After applying this PR, the plugin works well.
### Checklist
- [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
- [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
- [x] Added automated test coverage as appropriate for this change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org