question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make `tns run` use livesync by default

See original GitHub issue

I’ve spent some time over the holidays playing with a variety of frameworks, and one thing I’ve noticed is that livesync functionality is increasingly the default behavior that developers expect. React Native watches by default, and Angular 2’s setup does as well.

My suggestion is to have tns run also setup/run tns livesync by default (and perhaps provide a --no-livesync flag to turn it off or something like that). IMO this would significantly help the getting started experience. One complication is that we probably want https://github.com/NativeScript/nativescript-cli/issues/763 implemented first, so that tns run continues to show console logs and stack traces.

UPDATE (May 20th, 2016): #763 was implemented and shipped in 2.0.

One alternative is that we could include a handful of npm scripts in the default project’s package.json. Something like npm run ios|android that runs the app and sets up a watcher by default. For example in Angular 2 npm start, starts a browser tab and an HTTP server, watches for changes to code, and deploys those changes automatically.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
atanasovgcommented, Jun 3, 2016

I support this only given that livesync works as expected. Otherwise we’d need a separate option in the tns run command, purely for the sake of disabling the implicit livesync behavior. I guess writing tns run --nolivesync doesn’t seem appealing to anyone here 😃

We should also consider this from the VSCode extension perspective. @ivanbuhov @blagoev What do you think guys?

2reactions
sitefinitystevecommented, May 20, 2016

…IMO --watch by default as well, whats the use case for livesync with no watch specified?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the purpose of `tns livesync` apart from the `--watch` flag?
When I run tns livesync android , it detects when I save a file, outputting "Applying changes...\nSuccessfully synced application ...
Read more >
Edit with live reloading using NativeScript livesync | egghead.io
Learn how to use the livesync option to make quick changes to css and/or Angular components to see live updates in the emulators...
Read more >
CLI Basics - NativeScript Docs
Exercise: Use the tns create command. Open your terminal or command prompt and run the following command to create a new NativeScript application....
Read more >
Starting NativeScript Apps From Templates - TJ VanToll
The easiest way to use the --template option is to point it at an ... This is the default app you get if...
Read more >
Some quick NativeScript tips - Raymond Camden
I kill livesync, add the plugin, and then run livesync again. ... So for me, I got used to doing tns build android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found