Skip to content

ionicappdevelopment/basic-app

Repository files navigation

Setup

To install ionic cli

  • For a photo gallery project with Angular and Capacitor:
npm install -g @ionic/cli native-run cordova-res
  • For an Ionic Angular project:
npm install @capacitor/camera @capacitor/storage @capacitor/filesystem
  • To create a blank project:
npm install @ionic/pwa-elements

To create new project

  • For a photo gallery project with Angular and Capacitor:
ionic start photo-gallery tabs --type=angular --capacitor
  • For an Ionic Angular project:
ionic start firstapp --type=ionic-angular
  • For create a blank project:
ionic start firstapp blank
  • To start a local development server:
ionic serve
  • To check ionic version
ionic info
  • To generate a page
ionic generate page users
  • To generate a new service:
ionic g service services/photo



The apk is generated in this folder C:\Users\pcUsername\firstapp\platforms\android\build\outputs\apk

  • To uninstall the global Ionic CLI:
npm uninstall -g ionic

Build Process

Building for iOS:

ionic build
ionic cap add ios

Building for Android:

ionic build
ionic cap add android
  • sync and copy files:
ionic cap copy
ionic cap sync
  • To open the Android project in Android Studio:
ionic cap open android
  • run on wifi
ionic capacitor run android -l --external

Deploying app in android-

ionic Cordova platform add android
ionic cordova build android --prod --release // flags optional

or

ionic capacitor build android
ionic capacitor build android --prod --release
  • To assemble the APK using Gradle:
 ionic capacitor copy android 
 cd android 
 ./gradlew assembleDebug 
 cd ..

  • get git origin
git config --get remote.origin.url
  • For checking the Git remote repository:
git remote -v