Skip to content

Fix debug android --emulator #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2016
Merged

Conversation

rosen-vladimirov
Copy link
Contributor

Fix tns debug android --emulator. There were two issues:

  • With latest changes in master/release branch, when there's no android device detected and user executes tns debug android --emulator an error is raised - "Cannot find connected devices...". Fix this by returning true in command's canExecute method when --emulator is passed.
  • When there's no running emulator, CLI tries to start it (android-debug-service, debugOnEmulator method). The emulator is started and after that we try to execute action on the started device.
    However devicesService (in this case the androidDeviceDiscovery) had not reported yet the started emulator as a new device. So when device's service execute method is called, it checks if there are devices (still thinks there aren't) and tries to start emulator again.
    The final result is that application starts on the device, but there's no debugger attached.
    Fix this by forcing android device detection in debugOnEmulator method.

#1437

Fix `tns debug android --emulator`. There were two issues:
* With latest changes in master/release branch, when there's no android device detected and user executes `tns debug android --emulator` an error is raised - "Cannot find connected devices...". Fix this by returning true in command's canExecute method when `--emulator` is passed.
* When there's no running emulator, CLI tries to start it (android-debug-service, debugOnEmulator method). The emulator is started and after that we try to execute action on the started device.
However devicesService (in this case the androidDeviceDiscovery) had not reported yet the started emulator as a new device. So when device's service execute method is called, it checks if there are devices (still thinks there aren't) and tries to start emulator again.
The final result is that application starts on the device, but there's no debugger attached.
Fix this by forcing android device detection in debugOnEmulator method.
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 12, 2016
@rosen-vladimirov rosen-vladimirov added this to the 1.6.0 milestone Feb 12, 2016
@teobugslayer
Copy link
Contributor

👍 nice catch!

rosen-vladimirov added a commit that referenced this pull request Feb 12, 2016
@rosen-vladimirov rosen-vladimirov merged commit c89e9b2 into release Feb 12, 2016
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-debug-emulator branch February 12, 2016 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants