nativescript --version
|
This returns the version of the nativescript command. If you are running an older version, then you can use npm to upgrade your nativescript command like this: npm install -g nativescript .
|
nativescript create <your project name>
|
This creates a brand new project.
|
nativescript platform add <platform>
|
This adds a target platform to your project.
|
nativescript platform list
|
This shows you what platforms you are currently targeting.
|
nativescript platform remove <platform>
|
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 remove command.
|
nativescript platform update <platform>
|
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.
|
nativescript build <platform>
|
This builds the application for that platform.
|
nativescript deploy <platform>
|
This builds and deploys the application to a physical or virtual device for that platform.
|
nativescript emulate <platform>
|
This builds and deploys the application to an emulator.
|
nativescript run <platform>
|
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.
|
nativescript debug <platform>
|
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.
|
nativescript plugin add <plugin>
|
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.
|
nativescript livesync - -watch
|
This allows you to have the nativescript command watch for changes and automatically push them to the device. This is probably the third most used command if you are not using a better third-party LiveSync system. We call it LiveSync because it automatically syncs all your changes directly to the device in real time, without you having to rebuild the application. This speeds up your development of an application drastically.
|
nativescript doctor
|
This allows you to run some diagnostic checks on your environment if the nativescript command does not appear to be working.
|
nativescript install
|
This will (re)install any dependencies listed in your package.json file. The package.json file is typically modified by the plugin or library add function, so this is used typically to reinstall the plugins or libraries in the event you add a new platform or reinstall one.
|
nativescript test [ init | <platform> ]
|
This allows you to create or run any tests for your application. Using init will initialize the test framework for the application. Then, you just use the platform to run the tests on that platform.
|