You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix UnhandledRejection error when failed to start application on iOS during debug
In case we are unable to start application on iOS device just before attaching a debugger, CLI will raise unhandled rejection.
The problem is that we want to start two actions in parallel - start of application and attaching a debugger.
We do not await the start application and when an error is raised in it, Unhandled Rejection is raised.
In order to prevent this, use Promise.all - this way in case any of the operations fail, we'll receive it as error in the same method.
* Fix attaching multiple times on deviceLost event
In LiveSync service we attach to deviceLost event in order to stop LiveSync operation in case device is detached. However we are attaching it on every change, so at some point CLI prints warning:
`Warning: Possible EventEmitter memory leak detected. 11 deviceLost listeners added. Use emitter.setMaxListeners() to increase limit `
Fix this by attaching only once.
* Fix application is not started on iOS Simulator every other time
In case you are using iOS Simulator with version < 10, every second LiveSync operation does not start the app on device. The problem is that calling `simctl terminate` is not killing the app immediately.
However the action is executed, so we call start application. After its been called, the terminate succeeds and kills the app. So the app is not running. When a change is applied we detect app is not running and just start it.
So it works. Next change calls terminate and again the app seems like it has not been started.
The fix is in ios-sim-portable, so update its version.
* Fix executing of deploy/start app on device, which is not passed to the method
In PlatformService we create a canExecute method that does not work correctly in cases when CLI is used as a library. The problem is that in this case methods like `deployPlatform` and `startApplication` receive the device on which to execute the action through their arguments. However, the canExecute method relies on the `devicesService.getDeviceByDeviceOption()` method, which works with the `$options.device`. The last is never set in cases when CLI is used as a library. So the canExecute is changed and now it will work only in case it receives deviceIdentifier as argument. This requires changes in `startApplication` and `deployPlatform` methods, so they will send the deviceIdentifier to canExecute method.
this.$logger.trace(`Received ${DeviceDiscoveryEventNames.DEVICE_LOST} event in LiveSync service for ${device.deviceInfo.identifier}. Will stop LiveSync operation for this device.`);
0 commit comments