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

Run/debug commands should not try to deploy on connected but not paired devices #1882

Closed
pkoleva opened this issue Jun 27, 2016 · 7 comments
Closed
Assignees
Milestone

Comments

@pkoleva
Copy link
Contributor

pkoleva commented Jun 27, 2016

Steps to repro:

  1. Connect an android device via USB but do not allow USB debugging
  2. Execute tns run/debug command

Expected result: Emulator is started if no other paired device is running
Actual result: A message that deployment is successful appears, but the app is not actually deployed

@pkoleva pkoleva added the bug label Jun 27, 2016
@tsonevn tsonevn added this to the 2.5.0 milestone Dec 5, 2016
@pkoleva pkoleva removed this from the 2.5.0 milestone Jan 5, 2017
Plamen5kov added a commit to telerik/mobile-cli-lib that referenced this issue Jan 31, 2017
@Plamen5kov Plamen5kov self-assigned this Feb 1, 2017
@Plamen5kov Plamen5kov modified the milestones: 2.6.0 (TBD), 3.0.0 Feb 1, 2017
@Plamen5kov
Copy link
Contributor

Plamen5kov commented Mar 13, 2017

Expected behavior:
Please vote for the expected behavior in the following scenario:
You have connected a device but this device is not authorized. What should happen when you run: tns run android command:

  • option 1: warning: this device is not authorized(paired) so we'll start the default emulator
  • option 2: warning: this device is not authorized(paired) + kill process + message: if you want to run the application with an emulator please run tns run android --emulator
  • option 3: error: this device is not authorized + kill the process

Ping: @NativeScript/android-runtime @dtopuzov @vchimev @yyosifov

@petekanev
Copy link
Contributor

@Plamen5kov based on my experience with the CLI, I would consider option 2 as the way to go. More often than not I would connect an unathorized device that I just forget to pair to the PC. If a native emulator was to boot up it would most likely be slow because I can either use HAXM + native emulator or Genymotion setup, and I prefer Genymotion.

Is there a mechanism in place to check whether a device is connected, but not paired (or no usb debugging enabled)? We can also list all paired devices (similar to what tns devices would output) if tns run fails.

@Plamen5kov
Copy link
Contributor

@Pip3r4o connected, but not paired devices are displayed by tns device command like:

device id status
some_id unauthorized

The current exception is: device is not authorized, so displaying tns device result, would be pretty much the same as the exception.

@dtopuzov
Copy link
Contributor

dtopuzov commented Mar 14, 2017

@Plamen5kov My favorite is option2, but I'll be happy with all the options in general.

@Plamen5kov
Copy link
Contributor

Implementing:
error: this device is not authorized(paired) + kill process + message: if you want to run the application with an emulator please run tns run android --emulator
by popular vote.

@dtopuzov
Copy link
Contributor

Actual result with {N} CLI 3.0.0-2017.4.21.1

Skipping prepare.
Searching for devices...
Skipping package build. No changes detected on the native side. This will be fast!
Multiple errors were thrown:
The device is not authorized. Please use the --emulator flag to run the application on on an emulator

Looks ok to me.

@Liooo
Copy link

Liooo commented Jul 12, 2017

For guys seeing this in the future:

I had the same error on the emulator running Android7.0 (the one with GooglePlay app preinstalled).
Turning on USB debugging inside the emulator (setting->Developer options) fixed the problem.

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

7 participants