Hugos68 / capkit

CLI to integrate Capacitor into SvelteKit
https://www.npmjs.com/package/capkit
MIT License
40 stars 1 forks source link

How to Run in a Emulator? #68

Closed KiddoV closed 8 months ago

KiddoV commented 9 months ago

How do I run my app in a emulator. Says Android Emulator?

Hugos68 commented 9 months ago

You can run the dev server like so:

npm run dev:cap

This will run and expose your development server to your local network. After your server is running you can run:

npx cap open android

This will open android studio and open your project, after that simply start a virtual device and open the browser and go to the dev server's URL.

If you want to run the native module you can run:

npm run build:cap

This will generate the android binaries in the /android folder (assuming you've added the android platform) Let me know if you get stuck on anything.

luisfontes commented 9 months ago

For those on Windows, Android Studio must be installed on WSL2. I followed this tutorial and got the simulator working: https://www.charcoalstyles.com/blog/android-development-in-wsl2/

Hugos68 commented 9 months ago

For those on Windows, Android Studio must be installed on WSL2. I followed this tutorial and got the simulator working: https://www.charcoalstyles.com/blog/android-development-in-wsl2/

I am on windows FYI and it works fine without WSL/WSL2

Hugos68 commented 8 months ago

Assuming you didn't have any more questions I am going to close this for now.