tips:capacitor

Capacitor

initialize ionic project

npm install -g ionic

# select N for cordova
ionic start myApp sidemenu
cd myApp

# capacitor conflicts with Cordova's Splashscreen Plugin
npm uninstall --save cordova-plugin-splashscreen

add capacitor

npm install --save @capacitor/core @capacitor/cli

npx cap init

# or ...
npx cap init gianomobile org.csgalileo.gianomobile

build www folder

npm run build

add platform

npx cap add android
npx cap sync


# desktop
# npx cap add electron

android studio:

  • remove android/.grade and android/.idea folders
  • adjust android/local.properties
  • import project as external gradle model from <project/android> folder
local.properties
ndk.dir=/opt/android-ndk-r14b
sdk.dir=/opt/android-sdk

add plugin

npm install really-cool-plugin
npx cap update
  • ionic serve
  • edit sources

deploy:

  • npm run build
  • npx cap sync # to sync platforms
  • apk with android studio
  • tips/capacitor.txt
  • Last modified: 2018/03/29 12:55
  • by scipio