In this quick tutorial, I’ll show you how to use CapacitorJS to convert your existing Vue.js web app into a fully functional mobile app for Android and iOS — without rewriting your codebase.
▶️ Watch the full tutorial here
This method is the fastest way to bring your frontend skills to mobile platforms using tools you already know.
Commands Used in This Video:
Install the Capacitor CLI locally
npm install -D @capacitor/cli
Initialize Capacitor in your Vue project
npx cap init
Install the required packages
npm install @capacitor/core @capacitor/ios @capacitor/android
Add native platforms
npx cap add ios
npx cap add android
Build and sync your app
npm run build
npx cap sync
Open the native projects in your IDE
npx cap open ios
npx cap open android
What is CapacitorJS and Why Use It?
CapacitorJS is a modern open-source native runtime developed by the Ionic team. It allows developers to build cross-platform mobile apps using web technologies like HTML, CSS, and JavaScript — without needing to rewrite your app in native languages such as Swift or Kotlin.
With Capacitor, your web app runs inside a native WebView container, enabling it to function like a true mobile app. Beyond just wrapping your app, Capacitor provides easy access to native device features like the camera, filesystem, geolocation, push notifications, and more through a rich plugin ecosystem.
Cross-Framework Compatibility
One of Capacitor’s biggest strengths is that it works with any modern JavaScript framework. Whether you are using:
Vue.js (like in this tutorial)
React
Angular
Svelte
Or even plain vanilla JavaScript
Capacitor can seamlessly integrate with your existing project. This flexibility means you don’t need to change your frontend framework or rewrite your codebase to build mobile apps — just add Capacitor and you’re good to go.
Why Choose Capacitor Over Other Solutions?
Compared to alternatives like Cordova, Capacitor is:
More modern and lightweight, built with a focus on web standards and developer experience
Better integrated with native SDKs, giving you easier access to device APIs
Supports live reload and faster development cycles
Actively maintained and backed by the Ionic team, ensuring ongoing support and improvements
How Capacitor Works Under the Hood
Capacitor takes your built web app (the static files you generate when you run npm run build) and packages it inside a native project shell for iOS and Android. This native shell includes:
A WebView component that loads your web app
A bridge that connects JavaScript code to native device APIs
Native projects that you can open and customize in Xcode (for iOS) or Android Studio (for Android)
This means your app behaves just like a native app on mobile devices but allows you to write your entire UI and logic in web languages.
What You Need to Get Started
Your web app ready to build (Vue, React, Angular, or vanilla JS)
Node.js and npm installed on your system
Android Studio and/or Xcode installed for running native projects
Basic familiarity with command-line tools
Wrapping Up
Using CapacitorJS, you can quickly turn your existing web app into a mobile app without the overhead of learning native development. This is a huge advantage for web developers looking to expand their reach to mobile users efficiently.
If you’re comfortable building with Vue (or any JavaScript framework), adding Capacitor to your workflow will open up new possibilities for app distribution on mobile platforms — faster and easier than ever before.