Skip to content

CLI run/debug commands should detect the type of device #1763

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

Closed
blagoev opened this issue May 14, 2016 · 3 comments
Closed

CLI run/debug commands should detect the type of device #1763

blagoev opened this issue May 14, 2016 · 3 comments
Labels

Comments

@blagoev
Copy link
Contributor

blagoev commented May 14, 2016

When run/debug command is started it should detect the type of device and make the device Id optional in cases when only one device and one emulator is found.

--emulator and --device should detect the devices connected and ask for device id only when a decision can not be made.

@dtopuzov
Copy link
Contributor

dtopuzov commented May 14, 2016

In Android emulator and device are both devices, so with one emulator and one device you also can not make a decision.
I think we should work in the same way Android Studio works, otherwise we can confuse Android developers.

@blagoev
Copy link
Contributor Author

blagoev commented May 16, 2016

First lets say that there is a way to make a distinction between android device and android emulator.

Lets paraphrase this issue to be more clear.
The request is to handle tns commands as follows on the specific case when there one android emulator and one android device connected.

  • "tns debug android" should fail with asking the user to specify device id
  • "tns debug --emulator" should start the app on the emulator
  • "tns debug --device" should start the app on the device with no device Id parameter required

@dtopuzov Android Studio has one button to debug an application (not separate buttons for emulators and devices), thus showing a combined UI with all emulators and devices connected. Android Studio is not the best example in our case.

The better example is adb where:
"adb -e" command which given only one emulator, regardless how many devices there are, will start the next command on that emulator
"adb -d" command which give only one device is connected, regardless how many emulators there are, will start the command on that said device.

The problem manifests itself mostly in VS code where we have a UI for specifying emulator and device separately, ie "Launch on Android Device" and "Launch on Android Emulator". Currently there is a way to specify the deviceId with tnsArgs in launch.config json by manually editing the file. But having that the developer has one device and one emulator most of the time we should improve the experience.
In short there is no need for me to specify an emulator since I already selected that from the debug UI.

Having said this it is worth mentioning this is a usability improvement feature which will greatly ease the developer.

Hope this clears the confusion a bit.

@blagoev
Copy link
Contributor Author

blagoev commented Jun 30, 2016

After short discussion we decided to close this. The --emulator option will be depreciated soon and visual studio code {N} extension will have "Launch on Android" option only. This will start the app on the SINGLE available emulator or device or will fail if multiple devices are present. There is always an option to specify the target device using tnsArgs in launch.json file when multiple devices are connected. This will be on par with how CLI handles these cases.

closing this issue.

@blagoev blagoev closed this as completed Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants