Boilerplate code for basic capacitor integration. Following this guide you will be able to build and install your application on any device.
Follow those steps in order
npm install // You can always use pnpm for faster results
npm run build
npm exec cap add android // (or ios)
npm exec cap open android
npm exec cap open ios
Uncomment server property in capacitor.config.ts
Change the URL to your device's IP.
To find your device IP run ipconfig
.
Sync with your android/ios folder
npm exec cap sync
npm run dev
Now you just need to open your app platform (Android Studio, XCode etc) and rebuild and run the app. Try writing something to +page.svelte
and it should automatically appear in your device.
vite.config.ts
Here you can change the port the server will be serving to and enable/disable https.
capacitor.config.ts
Here you can change the IP the application will watch during development. You also control the app name, ID and build folder.
npm exec cap sync