Overview
ota-nativescript delivers signed over-the-air JavaScript and asset updates for NativeScript 9.1+ release builds without forking @nativescript/ios or @nativescript/android.
Why NativeScript needs a native pre-boot layer
Treating OTA updates in NativeScript as a JavaScript file copy breaks in three concrete ways:
- Broken updates cannot recover themselves. If a staged bundle throws on its first module import, no JavaScript rollback code executes. Bundle selection and launch-attempt tracking must execute in native code before V8 boots.
- Asset paths and runtime extraction collide. On Android,
knownFolders.currentApp()resolves tofiles/app, whileRuntimeHelperoverwritesfiles/appwhen the APK changes. Overwritingfiles/appdestroys the embedded fallback; loading JS from another directory without aligningfiles/appmixes stale~/...assets with new JS. - "Only TypeScript changed" is not a compatibility guarantee. NativeScript generates platform metadata (
metadata-*.bin,*.dat) and static native bindings (sbg-bindings.txt) during the binary build. A bundle calling native APIs or registering subclasses absent from the installed binary fails at runtime.
Packages
| Package | Role | Status |
|---|---|---|
@getcortexlabs/ota-protocol | Manifest/directive/boot-state schemas, RFC 8785 JCS canonicalization, path safety and error codes | Verified |
@getcortexlabs/ota-nativescript | Native iOS & Android boot selectors, CryptoKit / Google Tink Ed25519 + SHA-256 verification, background downloader, atomic staging, updates SDK and after-prepare hook | Verified |
@getcortexlabs/ota-cli | ota-ns CLI: keygen, per-platform fingerprint, Webpack pack, offline verify and local fault-injection serve | New |
Server-agnostic by design
The on-device SDK speaks an explicit, signed HTTP contract (POST /check, signed manifest.json, immutable file URLs, optional POST /events). You can host releases on static object storage + any backend, test locally with ota-ns serve, or connect Orbit once the hosted control plane lands.
What can ship over the air
| Change | OTA eligible? |
|---|---|
| Bug fixes in TypeScript/JavaScript logic or validation | Yes, when compatible with existing native metadata and bindings |
Layout, style, copy, images and updatable fonts (~/...) | Yes |
| Adding or updating an iOS Pod, SPM package, Gradle dependency or permission | No — requires a new store binary |
Upgrading @nativescript/ios, @nativescript/android or native bootstrapper code | No — requires a new store binary |
| Calling a native API or adding a native subclass missing from build metadata | No — caught by ota-ns fingerprint / pack |