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.
Installation agent prête
Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.
npx -y tokrepo@latest install a87b8fe7-3862-11f1-9bc6-00163e2b0d79 --target codexÀ exécuter après confirmation du plan en dry-run.
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.
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.
How to use
- Install the CLI with
npm install -g @nativescript/cliand runns doctorto verify your development environment (Xcode, Android SDK). - Create a new app with
ns create hello --template @nativescript/template-blank-ts. - Run on a simulator or device with
ns run iosorns run android.
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);
}
}
Related on TokRepo
- Coding AI Tools — Developer productivity and framework tools
- Automation Tools — Build and deployment automation
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.
Questions fréquentes
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.
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.
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.
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.
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.
Sources citées (3)
- NativeScript GitHub— NativeScript builds native iOS and Android apps with JavaScript/TypeScript using…
- NativeScript Documentation— Direct access to iOS and Android APIs from JavaScript
- NativeScript Official Site— NativeScript framework architecture and rendering
En lien sur TokRepo
Fil de discussion
Actifs similaires
React Native — Build Native Mobile Apps with React
React Native is the leading framework for building native iOS and Android apps using React. Write once in JavaScript/TypeScript, get truly native mobile apps — not webviews — with shared business logic and platform-specific UI when needed.
Fastlane — Automate Building and Releasing iOS and Android Apps
Fastlane is an open-source platform that simplifies iOS and Android deployment. It handles code signing, screenshots, beta distribution, and App Store releases from a single command.
Uno Platform — Pixel-Perfect Multi-Platform Apps with .NET
Build native mobile, desktop, and web applications from a single C# and XAML codebase targeting Windows, iOS, Android, macOS, Linux, and WebAssembly with pixel-perfect fidelity.
BeeWare Toga — Native Cross-Platform GUI Apps in Python
Write native desktop and mobile applications in pure Python that render with platform-native widgets on macOS, Windows, Linux, iOS, Android, and the web.