Ionic Launch Event. September 28th 2021.
Capacitor Android apps are configured and managed through Android Studio.
API 21+ (Android 5 or later) is supported, which represents over 95% of the Android market. Capacitor requires an Android WebView with Chrome version 60 or later. On Android 5 and 6, Capacitor uses the Android System WebView. On Android 7+, Google Chrome is used.
First, install the
npm install @capacitor/android
Then, add the Android platform.
npx cap add android
To open the project in Android Studio, run:
npx cap open android
Alternatively, you can open Android Studio and import the
android/ directory as an Android Studio project.
You can either run your app on the command-line or with Android Studio.
To use an Android Emulator you must use an API 24+ system image. The System WebView does not automatically update on emulators. Physical devices should work as low as API 21 as long as their System WebView is updated.
To run the project on a device or emulator, run:
npx cap run android
The command will prompt you to select a target.
Learn more about
In Android Studio, first select the device or emulator and then click the run or debug button to run your app. Unless you’re debugging Java or Kotlin code, the run button is preferred.
If your app ran you are now ready to continue developing and building your app. Use the various APIs available, Capacitor or Cordova plugins, or custom native code to build out the rest of your app.
Follow these Android-specific guides for more information on setting permissions for your app, updating dependencies, building plugins, and more: