Hello All, Previously, We had discussed Ionic Cordova applications. Now, We have to move one step ahead and learn about capacitors. In this topic, we will discuss What is a capacitor? How to install & create an Ionic capacitor application on windows? How to run ionic capacitor application on android device? So, let’s start with Capacitor.
What is Capacitor?
The capacitor helps us to run Web applications natively on Android, IOS & Web. Capacitor. It works like Cordova. Most of the Cordova plugins are supported by Capacitor. It’s developed & maintain by Ionic.
Ionic Capacitor Android Application Installation Steps
Before Installing the Ionic We need to make sure that the following software’s are already installed on your Windows machine
- Android Studio
- Node JS
- Visual Studio Code
- Java JDK
How to Install Ionic on Windows machine?
npm install -g ionic@latest
Create Ionic capacitor project
ionic start <application_name> blank --type="angular" --capacitor
Add platform (Android) to Ionic capacitor project
ionic capacitor add android
Build Ionic capacitor project
Serve Ionic capacitor project
How to run Ionic capacitor application on android device?
- Connect Android device to machine
- Make sure your developer mode is enabled on device
- Build the application using command -> ionic build
- Sync application using command -> npx cap sync
- Open Android studio with command -> npx cap open android
- Select connected device in Android studio, If device not appear in list, Write command -> adb devices
- Finally, Run the application.