The NativeScript command line
Now, before we get to the creating a project part, let us have an overview of the commands available from the new nativescript
command you just installed. If you forget any of these, you can easily type nativescript
alone without any parameters to see a help screen at a console window, or type nativescript /?
for a help screen in your browser.
NativeScript commands
These are just some of the most commonly used valid commands for the nativescript
command. Several of these we will be covering as we progress in the book.
Command line |
Description |
---|---|
|
This returns the version of the |
|
This creates a brand new project. |
|
This adds a target platform to your project. |
|
This shows you what platforms you are currently targeting. |
|
This command is normally not needed, but if you are messing with the platform directory and totally mess up your platform, you can remove and then add it back. Please note this deletes the entire platform directory, so if you have any specific customizations to your Android manifest or iOS Xcode project file, you should back it up before running the |
|
This is actually a pretty important command. NativeScript is still a very active project under a lot of development. This command upgrades your platform code to the latest version, which typically eliminates bugs and adds lots of new features. Please note this should also be done with an upgrade of the common JavaScript libraries as most of the time, they also are typically in sync with each other. |
|
This builds the application for that platform. |
|
This builds and deploys the application to a physical or virtual device for that platform. |
|
This builds and deploys the application to an emulator. |
|
This builds, deploys, and starts the application on a physical device or an emulator. This is the command you will use the majority of the time to run your application and check out the changes. |
|
This builds, deploys, and then starts the application on a physical device or an emulator in debug mode. This is probably the second most used command. |
|
This allows you to add a third-party plugin or component. These plugins typically include JavaScript based code, but occasionally, they might also contain an actual compiled Java or ObjectiveC library. |
|
This allows you to have the |
|
This allows you to run some diagnostic checks on your environment if the |
|
This will (re)install any dependencies listed in your |
|
This allows you to create or run any tests for your application. Using |
Now that we have described some of the commands, let's use them to create your first mobile app via the nativescript
command tool.