Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 15, 2026·3 min de lectura

NativeScript — Build Truly Native iOS and Android Apps with JavaScript or TypeScript

NativeScript lets you build iOS and Android apps with one JavaScript/TypeScript codebase that renders to native UI widgets (not WebView). Direct access to every iOS and Android API from JS.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
step-1.md
Comando de instalación directa
npx -y tokrepo@latest install a87b8fe7-3862-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

TL;DR
NativeScript lets you build native iOS and Android apps with JavaScript/TypeScript using native UI widgets and direct access to every platform API.
§01

What it is

NativeScript is an open-source framework for building native iOS and Android apps with JavaScript or TypeScript. Unlike hybrid frameworks that wrap web content in a WebView, NativeScript renders actual native UI widgets. It provides direct access to every iOS and Android API from JavaScript, with no bridge overhead for simple API calls.

NativeScript targets mobile developers who want native performance and platform API access while writing in JavaScript or TypeScript. It supports Angular, Vue, Svelte, and React as UI frameworks, or you can use plain TypeScript.

§02

How it saves time or tokens

NativeScript uses one codebase for both iOS and Android while rendering native UI components. You avoid maintaining separate Swift/Kotlin codebases. Direct API access means you call platform APIs from JavaScript without writing native plugins for common tasks. The CLI provides hot reload during development, and the framework handles platform-specific adaptations automatically.

§03

How to use

  1. Install the CLI with npm install -g @nativescript/cli and run ns doctor to verify your development environment (Xcode, Android SDK).
  2. Create a new app with ns create hello --template @nativescript/template-blank-ts.
  3. Run on a simulator or device with ns run ios or ns run android.
§04

Example

# Install CLI
npm install -g @nativescript/cli
ns doctor

# Create app with TypeScript template
ns create my-app --template @nativescript/template-blank-ts
cd my-app

# Run on iOS simulator
ns run ios

# Run on Android emulator
ns run android
// app/main-view-model.ts
import { Observable } from '@nativescript/core';

export class MainViewModel extends Observable {
  private _counter = 0;

  get message(): string {
    return `Tapped ${this._counter} times`;
  }

  onTap(): void {
    this._counter++;
    this.notifyPropertyChange('message', this.message);
  }
}
§05

Related on TokRepo

§06

Common pitfalls

  • NativeScript requires Xcode for iOS builds and Android SDK for Android builds. You cannot build iOS apps on Windows or Linux.
  • Some npm packages that rely on browser APIs (DOM, window) do not work in NativeScript. Check plugin compatibility before depending on web-oriented packages.
  • Performance-sensitive animations should use the NativeScript animation API rather than JavaScript timers. The animation API runs on the native UI thread.

Preguntas frecuentes

How does NativeScript differ from React Native?+

Both render native UI, but NativeScript provides direct access to every platform API from JavaScript without bridges for simple calls. React Native uses a bridge (or the new architecture with JSI) for native communication. NativeScript supports Angular, Vue, Svelte, and React, while React Native is React-only.

Can I use npm packages with NativeScript?+

Yes, as long as they do not depend on browser-specific APIs like DOM or window. Many npm packages for business logic, data processing, and networking work fine. NativeScript-specific plugins are available for native device features.

Does NativeScript support hot reload?+

Yes. The NativeScript CLI provides HMR (Hot Module Replacement) during development. Changes to TypeScript, CSS, and XML files are reflected on the device or simulator without a full rebuild.

Is NativeScript free?+

Yes. NativeScript is fully open-source under the Apache 2.0 license. There are no paid tiers for the framework itself. Some third-party UI component libraries offer premium components.

What UI frameworks work with NativeScript?+

NativeScript supports Angular, Vue.js, Svelte, React, and plain TypeScript/JavaScript. Each framework flavor has its own project template and component syntax while sharing the same native rendering engine.

Referencias (3)

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados