Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sample android app does not deploy in android device

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

like image 770
chip Avatar asked Mar 25 '26 21:03

chip


2 Answers

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.

like image 178
Sonam Sinha Avatar answered Mar 29 '26 14:03

Sonam Sinha


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.

like image 45
F43nd1r Avatar answered Mar 29 '26 13:03

F43nd1r