Skip to content
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

Improve selection of device/emulator for debugging #2966

Closed
rosen-vladimirov opened this issue Jul 10, 2017 · 1 comment
Closed

Improve selection of device/emulator for debugging #2966

rosen-vladimirov opened this issue Jul 10, 2017 · 1 comment
Assignees
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Tell us about the problem

Currently CLI automatically selects which device/emulator to be used for debugging in case there's more than one device/emulator running. Instead of automatic selection, we should ask the user what they want to do.

Here's the idea:
In case the terminal is interactive and there are more than one devices/emulators running, prompt the user to select device for debugging.
In case the terminal is interactive and --emulator is passed, the prompter should contain only currently running emulators. In case there's no running emulators, CLI will start one and it will be used for debugging.
In case terminal is interactive and --for-device is passed, the prompter should contain only currently attached devices (no emulators/simulators). In case there's no attached devices, CLI will fail.

In case the terminal is not interactive and there are more than one devices/emulators, CLI will use the emulator with highest API version, i.e. in case you have three Android emulators with version 5.1, 6.0 and 7.0, the one with 7.0 will be used for debugging. In case there are no emulators running, but multiple devices are attached, CLI will use the device with highest API Level.

In case the terminal is not interactive and there are more than one emulators and --emulator flag is passed, CLI will use the emulator with highest API Level. In case there's no running emulator, CLI will start one and use it for debugging.
In case the terminal is not interactive and there are more than one devices attached and --for-device flag is passed, CLI will use the device with highest API Level. In case there's no device attached for specified platform, CLI will fail.

NOTE: In all scenarios only Trusted devices for specified platform are counted, i.e. in case you have Android device attached, that is not trusted and another Android device, that's ready for debugging, only the second one will be considered. The first one is not taken into action.

Which platform(s) does your issue occur on?

Both

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.x.x
@Plamen5kov
Copy link
Contributor

Part of these features were implemented after this PR.
Find more information here
In short you can debug specific devices by running:
tns debug <platform> --device <id>
and <id> can be found by running:
tns device <platform> --available-devices

@rosen-vladimirov rosen-vladimirov modified the milestones: 3.1.3, 3.2.0 Jul 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants