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

Establish a recommended workflow for simultaneous Android & iOS development #2470

Closed
tjvantoll opened this issue Feb 1, 2017 · 9 comments
Closed
Assignees
Labels
Milestone

Comments

@tjvantoll
Copy link
Contributor

tjvantoll commented Feb 1, 2017

I commonly develop on Android & iOS at the same time, and I believe a lot of our users do as well. Before the 2.5 release I ran tns run android and tns run ios, and then ran tns livesync --watch to watch both platforms simultaneously.

Since 2.5 that workflow no longer really works. The livesync command is now marked as deprecated, and executing two separate tns run commands is problematic.

With that in mind we need to establish a recommended workflow for cross-platform simultaneous development. Let’s list ideas in this issue; I’ll start with an idea I’m stealing from @bundyo.

What if we made tns run with no platform work. On macOS, tns run could build and deploy for iOS and Android, and watch each. On Windows and Linux tns run could build and deploy for just Android, and watch there as well.

Thoughts? Other ideas? Regardless of what we come up with I do think it’s important to have an established workflow for this common scenario for our next release.

@Plamen5kov
Copy link
Contributor

Plamen5kov commented Feb 1, 2017

related issue: #2445

My vote goes to running livesync/run for each platform. In other words always specifying the platform. Simply because it's less error prone.

@bundyo
Copy link

bundyo commented Feb 1, 2017

I don't think tns run is error prone - we can detect the connected devices and emulators and build&deploy to them. I actually expected that to work, as it is the default behavior in Cordova CLI.

@Plamen5kov
Copy link
Contributor

Cordova CLI is different and I don't think it's a good measure. We can make anything work, that's a fact. I prefer taking the safest rout and making the commands stable before anything else.

@jlooper
Copy link

jlooper commented Feb 1, 2017

Just adding a vote for tns run. Right now if I start emulating iOS, and then start Genymotion to view the app on Android, the iOS emulator starts looping crazily and vice versa if I start on Android.

@ejsuncy
Copy link

ejsuncy commented May 1, 2017

Looking forward to a resolution on this--I'm demoing NS 3.0.0-rc.1 to my dev team at work and was hoping to show simultaneous android & ios live reloading.

@rosen-vladimirov
Copy link
Contributor

Hey @jlooper , @tjvantoll , @ejsuncy ,
In the last weeks we've worked on implementing this feature and we are now ready to ship it. You can try it now with CLI's next version while we are preparing official release, where it will be included.
The idea is to use $ tns run command and the command will work with all running devices and emulators. In case there's not running devices/emulators, the command will fail.

Please give it a try and inform us in case you have any questions or concerns.

@tjvantoll
Copy link
Contributor Author

@rosen-vladimirov Just tested this out and it works great!


Long term I wonder if we could come up with a way to also launch an emulator as part of this command. My typical use case is I want to deploy my app to an iOS simulator and Android emulator... but I have neither of those things open at the moment.

With this command I can now do tns run ios, Ctrl + C, tns run android, Ctrl + C, tns run, which does give me the exact workflow I want, but is a bit tedious. I suppose I could manually launch the simulators from Xcode and Android Studio, but I’m just so lazy.

Anyways, something to monitor to see if this is just me. For now tns run is an awesome feature and I can finally develop on Android & iOS simultaneously again. This is going to be great for gifs and demos 😄

@rosen-vladimirov
Copy link
Contributor

Hey @tjvantoll ,
I'm glad the command is finally working for cross-platform development 🥇

We were wondering the same thing - should we start emulator/simulator with tns run and if yes, when should we do it. Currently we've decided to make the command working with all available devices and to fail in case there aren't any available instances.
For example, in case you are working on macOS and you have attached Android device, should the tns run command start iOS Simulator?

Lets see what the community will think about the idea, maybe it is worth creating a separate issue for this.

Btw the latest official CLI release - 3.1.3 has the tns run command working as described here.

@tjvantoll
Copy link
Contributor Author

@rosen-vladimirov Agreed. I think it would be weird if tns run just launched emulators by default. I went ahead and created that separate issue to start the discussion: #3009.

I think this issue can be closed as simultaneous development is now totally possible 😄 We can discuss in #3009 if we can further improve the current workflow.

Thanks!

dtopuzov added a commit to NativeScript/nativescript-cli-tests that referenced this issue Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants