Have you ever been wondering how to:
If so, the NativeScript Remote Plugins is just for you! :rocket:
The plugin is using several NativeScript CLI hooks and modifying its behavior by:
The rest of the CLI logic is working as usual, for example, the tns debug command is preparing the JavaScript, uploading it to the connected devices, showing logs, opening debug sockets, showing an URL for debugging and so on.
Comparing the cloud builds part of the NativeScript Cloud extension and the NativeScript Remote Builds plugin, they look similar.
The main differences come from the fact that the NativeScript Remote Builds plugin enables the existing NativeScript CLI commands on environments without any native tooling[1] requirements instead of providing additional commands like the tns cloud
ones. The Remote Builds plugin is also designed to be stable and reliable in a CI environement.
Here's a comparison table between the NativeScript Cloud Extension and the NativeScript Remote Builds plugin:
Cloud Extension | Remote Builds Plugin | |
---|---|---|
Build, Run and Publish without native tooling[1] | ||
Debug without native tooling[1] | [2] | |
Run Unit Tests without native tooling[1] | ||
Automatic iOS Signing Management[3] | ||
Full CI Support[4] | ||
Full Environment Information[5] | ||
Full Environment Control[6] | ||
Just the default NativeScript CLI commands | ||
Free | [7] | [8] |
The comparison is based on the CircleCI remote of the NativeScript Remote Builds Plugin
It's just a regular NativeScript plugin and could be installed from npm:
1) cd {{yourNativeScriptAppRoot}}
2) npm i nativescript-remote-builds
In addition, as the plugin is written in JavaScript, it allows a direct GitHub installation:
1) cd {{yourNativeScriptAppRoot}}
2) npm i https://github.com/NativeScript/nativescript-remote-builds/tarball/master
IMPORTANT: The plugin depends on NativeScript CLI hooks even before the CLI installs the node packages. If you delete your
node_modules
folder, ensure thatnpm i
is called before thetns
commands, otherwise you could get unexpected exceptions.
The plugin supports two configuration files expected in your NativeScript app root directory:
.nsremote.config.json
- the main plugin config where you have to select a remote
, follow the remote setup section for further details..nsremote.env.json
- an optional file allowing you to override the local and remote environment variables, most of them contain sensitive information and it's highly recommended to ignore it from your source control. NOTE: Both of the files are used only locally and replaced with an empty file when the plugin sends your app to the remote.
Just use the NativeScript CLI commands as usual. The plugin hooks to the NativeScript CLI build process and replaces it with remote builds. In addition, the tns publish android
command is now working and publishing the app from the remote.
You can always use your local machine instead of the remote builds by providing the --env.local
argument to your CLI commands. For example:
$ tns run android --env.local