3

I'm just starting to learn developing in android. I'm following the nativescript getting started guide but can't seem to proceed. It mentions to run tns run android while the phone is connected. but this doesn't seem to work. USB debugging is enabled on my phone and developer options.

at this point the project builds but does not appear on my phone. (I tried using the genymotion emulator before, maybe I'm wrong with my assumption that it would just appear in my android phone just like how genymotion does it)

check with tns devic command, it detects my android phone but says unreachable. what does that mean? also would there be other specific options in my phone that I need to set in order to have this app deployed on my phone?

screen after building and then running tns device

1
  • I'm guessing its from some sort of settings on your phone. I think when you connect your phone you're supposed to set it to photo transfer mode, then allow debugging. Commented Mar 25, 2016 at 22:58

4 Answers 4

3

I would suggest you try using ADB directly first. Following are the steps that can be used to push your app to your phone.

  1. First connect your phone to the linux machine using the USB port.
  2. Start adb server using adb start-server
  3. Run adb devices. This should list your phone below with a phone code or name.
  4. Transfer the apk to your phone using adb -s <device code> push <app_name>.apk
  5. The app should now be available on your phone.

You can also specify a location on your phone where you want your app to be pushed. Alternatively you can also use adb to install the app directly on your phone by using the following command : - adb install <app_name>.apk

Hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

A variant of this worked for me. * ran adb start-server (on windows 10 in command prompt) * disconnected my phone from the cable (HTC One) * waited for the USB debugging icons to disappear from the phone * re-connected the cable to the phone * finally got a prompt from the phone asking to approve access to the phone from my computer for debugging purposes (did not see this the first time I connected my phone) * gave permission * I was now able to see the device as available
1

You probably haven't turned on ADB debug mode on your phone.

Edit

Try to install an apk using adb directly. If that works tns is the problem. If that doesn't work, your setup is the problem.

1 Comment

I did this already, and I'm able to see USB debugging mode and it is currently turned on
1

If the adb is running and you are still not connectiong to your device after BUILD SUCCESSFUL you might want to try the following command

tns run android --log trace

This will give you addition debug information which you can shows us here in order to help you further.

Comments

1

I'm super late, but! if none of these options work, make sure you're using a proper USB cord to connect your device (try different cords)! That's why my device was undetected, even though the abd was running fine!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.