Latest Ext JS 8.1 is now available – Download now!

Build Mobile Apps with Ext JS and Capacitor – iOS and Android

May 26, 2026 ✎Nov 30, 2026 10219 Views

Get a summary of this article:

Build Mobile Apps with Ext JS and Capacitor - iOS and Android

You already have an Ext JS app. With Capacitor, you can ship that same app to the App Store and Google Play, with no rewrite and no second codebase. Capacitor wraps your compiled Ext JS build in a native iOS or Android shell and gives it access to device features like the camera, files and location.

TL;DR

  • What you get: your existing Ext JS app running as a native iOS and Android app, from one codebase.
  • How it works: Capacitor packages your compiled Ext JS build inside a native app and connects it to device features through plugins.
  • The steps: build your Ext JS app, install Capacitor, point it at your build folder, add Android and iOS, sync, then run in Android Studio or Xcode.
  • After every change: rebuild your Ext JS app, then run npx cap sync before rebuilding the mobile app.
  • You’ll need: Node.js, Android Studio for Android, and a Mac with Xcode for iOS.

What is Capacitor?

Capacitor is an open-source runtime from the Ionic team that turns a web application development software into a native iOS and Android app. Your web code runs inside a native WebView, and Capacitor plugins give it access to device features such as the camera, file system, geolocation, and notifications. It’s the modern successor to Apache Cordova.

The pairing works well: Ext JS brings a rich, enterprise-grade UI with 140+ UI components, and Capacitor handles everything native, from packaging and permissions to device APIs.

What you’ll need

Requirement Why Notes
Node.js and npm Run the Capacitor CLI and manage packages Use a current LTS version
An Ext JS app using the Modern toolkit The app you’ll wrap Modern is built for touch, fluid layouts and mobile performance
Capacitor CLI and Core Bridge your web app to the native platforms Installed per project (Step 2)
Android Studio Build, run and emulate the Android app Bundles Gradle through the Gradle wrapper, so no separate install
A Mac with Xcode Build, run and publish the iOS app Only needed for iOS

Step 1: Build your Ext JS app

Capacitor doesn’t compile your Ext JS code; it wraps a build that already exists. So start by making sure your app builds cleanly. For the best mobile experience, use the Modern toolkit, which is designed for touch, fluid layouts and mobile performance.

From your Ext JS project folder, run one of these:


    sencha app build production   # minified, ready to ship
    sencha app build testing      # easier to debug

The output lands in build/production/YourAppName (or build/testing/YourAppName). Note that path; you’ll point Capacitor at it in a moment.

working Ext JS project

Step 2: Install and set up Capacitor

Capacitor is installed per project. You can put it in one of two places:

  • The root of your Ext JS project: simplest, with everything in one folder.
  • A dedicated subfolder, such as mobile-app/: keeps native mobile files separate from your web workspace.

Run the following in whichever folder you choose.

2a. Create a package.json

Capacitor needs a package.json. If your folder doesn’t have one yet:


    npm init -y

Initialize npm

2b. Install Capacitor

Install the core runtime as a dependency and the CLI as a dev dependency:


    npm i @capacitor/core
    npm i -D @capacitor/cli

Install Capacitor

2c. Initialise the Capacitor project

Give your app a name and a unique package ID, and tell Capacitor where your Ext JS build lives:


    npx cap init "My App" com.company.myapp --web-dir build/production/MyApp

  • App name: the name users see under the app icon.
  • Package ID: a reverse-domain ID such as com.company.myapp. Choose carefully; it’s permanent once you publish.
  • Web directory (critical): the compiled Ext JS output folder. If Capacitor lives in a subfolder, use a relative path back to the root, such as ../build/production/MyApp.

This creates a capacitor.config.json (or .ts) file. You can change the web directory there later:


    {
      "appId": "com.company.myapp",
      "appName": "My App",
      "webDir": "build/production/MyApp"
    }

Creating a Capacitor project

Command summary

Command Summary

Step 3: Create and run the Android app

With Capacitor set up, add the Android platform, copy your Ext JS build into it, and run it. Run these commands in the same folder where you initialised Capacitor.

3a. Install the Android platform package


    npm i @capacitor/android

Install android platform package

3b. Generate the Android project


    npx cap add android

This creates an android/ folder containing a real, native Android project: Java/Kotlin source, Gradle configuration and the Android manifest. It’s normal source code, so commit it to version control.

Create android project

3c. Sync your Ext JS build into the app


    npx cap sync

sync copies your latest Ext JS build into the native project and updates native dependencies. Run it every time you rebuild your Ext JS app.

Sync project (copies from production to mobile app)

3d. Build and run

You have two options.

Option A: Android Studio (recommended)


    npx cap open android

Android Studio opens the project and fills in anything missing; on the first run it creates a local.properties file pointing at your Android SDK. Wait until the Gradle sync finishes, choose an emulator or a connected device, and press Run (the play button).

Open in android studio A

Open in android studio B

Open in android studio C

Option B: The command line, with no IDE

Use the Gradle wrapper that comes with the project, so you don’t need to install Gradle yourself:


    cd android
    ./gradlew assembleDebug        # macOS / Linux
    .\gradlew.bat assembleDebug    # Windows

The debug APK is written to android/app/build/outputs/apk/debug/app-debug.apk. Install it on a device or share it with testers.

Or build and launch in one step: npx cap run android.

Use Gradle to export instead of android studio A

Use Gradle to export instead of android studio B

Command summary

Command Summary (2)

Full reference: Capacitor Android documentation.

Step 4: Create and run the iOS app

You’ll need a Mac. Apple requires macOS and Xcode to build, run and publish iOS apps. You can prepare the project on Windows or Linux, but the final build has to happen on a Mac.

Run these in the same folder where you initialised Capacitor.

4a. Install the iOS platform package


    npm i @capacitor/ios

4b. Generate the iOS project


    npx cap add ios

This creates an ios/ folder with a native Xcode project. Like the Android folder, it’s real source code you should commit.

4c. Sync your Ext JS build


    npx cap sync

4d. Build and run

Open the project in Xcode:


    npx cap open ios

Choose a simulator or a connected iPhone, then press Run (the play button). To run on a physical device, select your Apple developer team under Signing & Capabilities first.

Or build and launch straight from the terminal:


    npx cap run ios

Command summary

Command summary (3)

Full reference: Capacitor iOS documentation.

Step 5: Add native permissions (camera, location, files)

New Android and iOS projects can’t touch sensitive hardware like the camera, GPS or photo library until you declare it. Skip this and the feature fails: iOS terminates the app the moment it asks for an undeclared permission, and Android denies access. Declare only what your app actually uses; app-store reviewers check.

Android: AndroidManifest.xml

Open android/app/src/main/AndroidManifest.xml and add <uses-permission> tags inside <manifest>, just before <application>:


    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Each Capacitor plugin’s documentation lists the exact permissions it needs, including the photo and media permissions that differ between Android versions.

iOS: Info.plist

Apple requires a permission and a plain-language reason, which is shown to the user in the permission prompt. Open ios/App/App/Info.plist (or the Info tab in Xcode) and add a key for each feature:


    <key>NSCameraUsageDescription</key>
    <string>Scan equipment QR codes and attach photos to inspections.</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Attach existing photos to your reports.</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Record where each inspection takes place.</string>

Write real reasons; vague ones like “needs camera access” are a common cause of App Store rejection.

Use device features from your Ext JS code

Permissions open the door; plugins walk through it. Install a plugin, sync, and call it from your Ext JS code. Here’s the Camera plugin:


    npm i @capacitor/camera
    npx cap sync

On a device, Capacitor makes installed plugins available on the global Capacitor object, so you can call them from an Ext JS controller without a bundler:


    Ext.define('MyApp.view.inspection.InspectionController', {
      extend: 'Ext.app.ViewController',
      alias: 'controller.inspection',

      onTakePhoto: async function () {
        if (!window.Capacitor || !Capacitor.isNativePlatform()) {
          Ext.toast('The camera is available in the mobile app.');
          return;
        }

        try {
          const { Camera } = Capacitor.Plugins;
          const photo = await Camera.getPhoto({
            quality: 80,
            resultType: 'uri',  // a file URI you can show directly
            source: 'CAMERA'
          });
          this.lookup('photoPreview').setSrc(photo.webPath); // an Ext.Img component
        } catch (e) {
          // The user cancelled or denied permission
        }
      }
    });

The isNativePlatform() check lets the same ReExt code keep running in a normal browser. Official plugins also cover geolocation, filesystem, push notifications, haptics, the status bar and more.

Speed up development with live reload

Rebuilding and syncing after every change gets slow. During development, you can point the mobile app at your machine’s Sencha dev server instead:

  1. Run sencha app watch in your Ext JS project (it serves on port 1841 by default).
  2. Add a server block to capacitor.config.json, using your computer’s local network IP:

    {
      "server": {
        "url": "http://192.168.1.20:1841",
        "cleartext": true
      }
    }

  1. Run npx cap sync, then run the app. Saved changes now appear on the device after a refresh.

Remove the server block before you build for release. Otherwise the published app will try to load from your laptop.

Your daily workflow

Capacitor doesn’t watch or compile your Ext JS code. Every time you change the app, run the same loop:


    sencha app build production   # 1. rebuild the web assets
    npx cap sync                  # 2. copy them into the native projects
    npx cap open android          # 3. run from Android Studio (or: npx cap open ios)

If the app on your device still shows old content, it’s almost always because step 2 was skipped. (Using live reload? You can skip steps 1 and 2 until you’re ready to test a real build.)

Publishing to Google Play and the App Store

Everything above produces debug builds for testing. Store releases need signed builds.

Google Play

  1. In Android Studio, choose Build → Generate Signed Bundle / APK and create a signed Android App Bundle (.aab); Google Play requires bundles for new apps.
  2. Create your app in the Google Play Console and upload the bundle, starting with an internal testing track.
  3. Fill in the store listing, content rating and data-safety form, then roll out.

Apple App Store

  1. In Xcode, set the device target to Any iOS Device, then choose Product → Archive.
  2. In the Organizer window, select Distribute App to App Store Connect.
  3. Test with TestFlight, complete the listing in App Store Connect, and submit for review.

You’ll need a Google Play developer account and an Apple Developer Program membership.

Keep your signing keys safe. Android updates must be signed with the same key as the original release (Play App Signing can manage this for you), and losing access can lock you out of updating your own app.

Troubleshooting

1. My changes don’t show up in the app

Symptom: you changed your Ext JS code and rebuilt the APK or IPA, but the app still shows the old version.

Fix: Capacitor doesn’t watch or compile your web code. Run sencha app build production and then npx cap sync before rebuilding the native app. Skipping the sync is the most common cause. Also check that webDir in capacitor.config points to the build folder you just updated (production vs testing).

2. Errors about mismatched Capacitor versions

Symptom: npx cap sync, Android Studio or Xcode throws dependency errors or complains about mismatched plugins.

Fix: every Capacitor package must be on the same major version. In package.json, check that @capacitor/core, @capacitor/cli, @capacitor/android, @capacitor/ios and any official plugins share a major version (use the current one listed on capacitorjs.com). After changing versions, delete node_modules, run npm install, then npx cap sync.

3. The app crashes or fails when using the camera, scanner or files

Symptom: the app installs and runs, but closes or fails as soon as you use the camera, a QR scanner or a file upload.

Fix: a native permission is missing. Add the <uses-permission> lines to AndroidManifest.xml and the usage descriptions to Info.plist (see Step 5), then rebuild.

4. Android Studio hangs or reports a missing SDK on first open

Symptom: after npx cap open android, Android Studio gets stuck loading, or complains about a missing SDK path.

Fix: on the first run, Android Studio creates local.properties to find your SDK and downloads the right Gradle version. Stay online, accept any SDK licence prompts (they appear in the bottom-right corner), and let the Gradle sync finish completely before building.

5. Command-line builds fail with “SDK tools missing” or “licences not accepted”

Symptom: npx cap run android or gradlew fails in the terminal, even though Android Studio is installed.

Fix: install the Android SDK command-line tools. In Android Studio, open Tools → SDK Manager → SDK Tools, tick Android SDK Command-line Tools (latest), and click Apply. Restart your terminal and try again. Also make sure ANDROID_HOME (or ANDROID_SDK_ROOT) points to your SDK folder.

6. A blank white screen on launch

Symptom: the app opens but shows nothing.

Fix: usually the webDir path is wrong or the build is missing, so Capacitor has no index.html to load. Confirm the path, rebuild, and sync. To see JavaScript errors, debug the WebView: use chrome://inspect in Chrome for Android, or Safari’s Develop menu for iOS.

Also Read: Creating a Mobile Application with Ext JS and Capacitor

Frequently asked questions

What is Capacitor and how does it work with Ext JS?

Capacitor is an open-source runtime that wraps a web app in a native iOS or Android app. You build your Ext JS app as usual, point Capacitor at the build folder, and it packages that build into native projects you can run and publish.

Can I turn an existing Ext JS web app into a mobile app?

Yes. If your app uses the Modern toolkit, you can wrap your existing production build without rewriting it. Test touch interactions and screen sizes on real devices, and add native permissions for any device features you use.

Can I use the Classic toolkit with Capacitor?

Technically it will run, but the Classic toolkit is designed for desktop mouse-and-keyboard use. For a good experience on phones and tablets, use the Modern toolkit, which is built for touch and responsive layouts.

How do I access the camera or GPS from Ext JS?

Install the matching Capacitor plugin (for example @capacitor/camera or @capacitor/geolocation), run npx cap sync, declare the permissions, and call the plugin from your Ext JS code through Capacitor.Plugins (see the example above).

Capacitor vs Cordova vs React Native: which should I use?

Use Capacitor to ship an existing web app, such as an Ext JS app, as a native app with modern tooling. Cordova is the older approach that Capacitor replaces. React Native renders native UI components and suits teams building mobile-first React apps from scratch.

Does Capacitor replace Cordova?

In practice, yes. Capacitor is the modern successor to Cordova from the Ionic team, and it supports many Cordova plugins. It offers easier access to native SDKs, and it treats your Android and iOS projects as real source code you own rather than hidden build artifacts.

Can I build an iOS app on Windows?

No. Apple requires macOS and Xcode to compile, sign and export iOS apps. You can write your Ext JS code, add the iOS platform and run npx cap sync on Windows, but building, emulating or publishing the app has to happen on a Mac.

Do I need to install Gradle separately?

No. Capacitor’s Android project includes the Gradle wrapper, which downloads exactly the Gradle version the build needs.

How do I build an Android APK from the command line?

From the android/ folder, run ./gradlew assembleDebug on macOS or Linux, or .\gradlew.bat assembleDebug on Windows. The APK is written to android/app/build/outputs/apk/debug/.

Do I need to run npm install inside the android/ or ios/ folders?

No. Only run npm install in the folder with your package.json. npx cap sync updates the native dependencies for you: Gradle for Android, and CocoaPods or Swift Package Manager for iOS, depending on your Capacitor version.

Is a Capacitor app as fast as a native app?

For most business apps, users won’t notice a difference. Your UI runs in a modern, fast WebView, and Ext JS’s virtualised grids keep large datasets smooth. Graphics-heavy games or apps with complex native animations are better served by fully native development.

How do I publish my Ext JS Capacitor app to the app stores?

Create a signed Android App Bundle in Android Studio for Google Play, and archive the app in Xcode for App Store Connect. Both stores need developer accounts and signed builds; see the publishing section above.

Build once, ship everywhere

With Ext JS and Capacitor, one codebase covers the web, iOS and Android, so your team builds features once and your users get the same rich, data-heavy interface wherever they work.

New to Ext JS? Try Sencha Ext JS free and take your first mobile app.

Sencha CTA Banner: Try Sencha Ext JS

Author

Cesar Martell

Additional Author(s)
  • Andres Villalba