divramod
divramod

Reputation: 1504

nativescript livereload on device

i am using https://github.com/NathanWalker/angular2-seed-advanced which creates a running nativescript app.

now, i am a starter with nativescript and wanted to ask, how i can achieve a good development flow.

i am coming from ionic where i was able to see the console output on my development machine and was able to test my app live on a cable connected device. live reloading was running also.

so my questions:

  1. can i run my app on a device without publishing it to the store
  2. will i be able to see the console.log output somehow on my local dev machine with adb or a nativescript cli command?
  3. is live reloading possible for developing nativescript apps?

Thank you in advance!

Upvotes: 4

Views: 3134

Answers (4)

divramod
divramod

Reputation: 1504

  1. yes
  2. yes
  3. yes

    tns livesync android --watch

Upvotes: 4

Nathanael
Nathanael

Reputation: 5399

  1. You can install the app to your own Android / iOS real devices and/or the iOS simulator and Android emulators, all without sending it to any of the stores.

  2. You can see the log fine, typically when you do a tns run [ios|android] the log is pipped back to your console. You can also run the standard adb logcat (android) or idevicesyslog (for iOS if installed)

  3. Live reloading is possible, and works fairly well. You can use the tns run [android|ios] which is built into the tns command line.

Upvotes: 3

Anand
Anand

Reputation: 10110

Here are the latest options(As of 2018-Jan) to run the app in live sync mode with a device when you are using NathanWalker -angular-seed-advanced.

iOS (device):   npm run start.ios.device --debug
Android (device):  npm run start.android.device --debug

--debug option will pull in more logs from the device(not just for your app, but also other activities)

Check the latest doc here for up-to date commands,

You can also use adb as explained here,

Upvotes: 0

ishandutta2007
ishandutta2007

Reputation: 18194

The answer to all three questions is yes (as another answer point out). To add to answer of question 3, As of nativescript version 2.5.0, tns run and tns livesync does the same thing, tns run has the ability to apply changes and sync it to a running app on device/emulator. The message on console clearly says tns livesync is being deprecated, so you should always look to use tns run

enter image description here

Upvotes: 0

Related Questions