1.1.1 • Published 3 years ago

nativescript-remote-builds v1.1.1

Weekly downloads
61
License
SEE LICENSE IN LI...
Repository
github
Last release
3 years ago

nativescript-remote-builds

Build Status

Have you ever been wondering how to:

  • build NativeScript apps for iOS on Windows or Linux?
  • setup a stable CI for your NativeScript apps?
  • avoid the iOS code signing management?

If so, the NativeScript Remote Plugins is just for you! :rocket:

How does it work?

The plugin is using several NativeScript CLI hooks and modifying its behavior by:

  • Skipping the local native tooling[1] requirements.
  • Skipping the native resources handling during the CLI prepare phase - they will be handled in the remote.
  • Replacing the CLI local build with the build method of the selected remote.

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.

How does it differ from the NaticeScript CLI Cloud extension?

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 ExtensionRemote Builds Plugin
Build, Run and Publish without native tooling[1]npm.ionpm.io
Debug without native tooling[1]    npm.io[2]npm.io
Run Unit Tests without native tooling[1]npm.ionpm.io
Automatic iOS Signing Management[3]npm.ionpm.io
Full CI Support[4]npm.ionpm.io
Full Environment Information[5]npm.ionpm.io
Full Environment Control[6]npm.ionpm.io
Just the default NativeScript CLI commandsnpm.ionpm.io
Free    npm.io[7]    npm.io[8]

The comparison is based on the CircleCI remote of the NativeScript Remote Builds Plugin

Installation

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 that npm i is called before the tns commands, otherwise you could get unexpected exceptions.

Setup

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.

Remote Setup

Usage

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.

Local Builds

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