/capacitor

Docker capacitor builder - provide your html5 output and it'll convert it to Android project and build it to .apk files

Primary LanguageShellApache License 2.0Apache-2.0

Docker capacitor builder

Provide your html5/web app dist output directory and this docker will convert it to Android 9.0 (28) project and build it to debug .apk file.

Prepare

Build your html5/web app and get a dist directory.

Create a directory app and put the dist inside.

Put your package.json into app also

app
    dist
    package.json

Convert web app to android and build

At same folder level with app directory (outside app), run

docker run --rm -it -v ./app:/app nguoianphu/capacitor

It will initialize capacitor into app folder and generate folder android. Then it will build the android with assembleDebug command.

The debug apk file will be available at app/android/app/build/outputs/apk/debug/

More

This images contains many Android and nodejs tools, you can try others commands as well

docker run --rm -it -v ./app:/app nguoianphu/capacitor bash

# Build android
cd android
export GRADLE_USER_HOME=/app/android/.gradle
./gradlew tasks
./gradlew assembleDebug

Docs

https://capacitorjs.com/docs/android

Github Action

Refer this github action if you want to build everything on github: https://github.com/nguoianphu/pkmn.help/blob/vitejs/.github/workflows/build.yml