See this presentation that was given on This Week in Svelte:
This is a simple demo project of SvelteKit + Capacitor. It is not a complete starter but more of an example of a Capacitor setup.
To add all the functionality, copy the contents of demo/complete/+page.svelte to src/routes/+page.svelte.
This demo only has iOS added to the project. Android can optionally be added via the instructions in the Capacitor documentation.
Basic steps:
- Follow the setup guide for setting up your environment under iOS
- Edit
capacitor.config.ts, underserver.url, add your local IP address. - Perform the commands below
nvm use
npm i
npm run dev- Start XCode and open the
/iosfolder in it via the "Open a project or file" button of the start screen. - Start the app either on a physical device or on an emulator via the Run ("Play") button
See these blog posts: