-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Unify and simplify workflows of build-related commands #475
Comments
Based on the description above, I've prepared the exepected behavior of the commands. platform addUsage:
prepareUsage:
buildUsage:
build for device or for emulatorcheck the table at the end for information which build should be executed. deployUsage:
runUsage:
debugWe have to select device for debugging, we cannot debug on all devices.
Building for emulator or for deviceThe table below illustrates different use cases when both Android and iOS platforms are added to your project.
As you can see there are some "critical" points here. First one is what to do in case user had not specified platform and there's a device attached from only one platform - should we use only the platform from the device attached or we should execute the command for both platforms (using emulator for the second one).
|
I'm voting for the following workflow:
|
Neatly organized table - well done! As for the case with an iOS device along with an emulator my vote goes to building for all of them. |
My vote goes for the following. When no platform is specified but there is at least one physical device/emulator connected/running - build, deploy or run for the attached device/process only. In the cases where we don't find a connected device and choose to launch the emulator, we should log a message that no physical devices were detected, so we're launching the emulator. |
I second @ikoevska. In my experience, although I have many attached device, my attention is always at a particular task at hand and I ignore devices of the "wrong" kind. Also, building for android, ios device and ios emulator is a very slow operation. That's why I prefer an approach "when in doubt, ask the user". I.e. when there are 2 platforms added and 2 kind of devices, just ask the user which one to use, either interactively or by requiring a special command line parameter. |
When you execute `tns run <platform>`, but you have forgotten to add the platform before that, you go in inconsistent state. Make sure to add the platform for the user when one of the following is executed: * `tns prepare <platform>` * `tns build <platform>` * `tns run <platform>` * `tns update <platform>@<version>` - this will add the specified version in case you have not added the platform before that. * `tns emulate <platform>` This way we simplify the workflow, now you can just do: 1) `tns create app1` 2) `tns run android --path app1` And the application will run on your attached device. Resolves #774 Part of the implementation of: #475
Do we also need a way of specifying which iOS version to start the emulator with? E.g.
I've made a small writeup of the problem in this issue: NativeScript/NativeScript#794 |
Ok, I'm closing this one, as most of the described behavior has been implemented. The current behavior of For iOS
For Android
|
Problem: Currently, the commands which include build - related steps differ slightly in their semantics, parameters and work flows.
Solution: Unify as much as possible but only where make sense.
Remark: All commands should work without specifying a platform if it is already added to the project. If more than one platform is added we should execute the command on all of them. If a user wants to run a particular platform she will be able to specify it as it currently works.
Prepare - stays as is
Build - stays as is
Deploy - does not work for emulators, does not run the app
-- device
Run - based on deploy
-- device
-- emulator android (device)
-- emulator ios
by default - build for simulator. Can be overridden by command line parameter. run [ios] --device. For android, running --geny instance must be reused
Debug = run + start debugger. works for android & ios, devices & emulators
Emulate = run --emulator. emulate --geny = run --geny
The text was updated successfully, but these errors were encountered: