This repository contains a setup guide and the source code for a hybrid mobile application built with Ionic 8 and Angular, leveraging the Standalone Components architecture. The app is optimized for deployment on GitHub Pages and is compatible with Android devices via Capacitor.
To avoid version conflicts in the development environment, using a Node.js version manager is highly recommended.
- Download the installer from the official repository: nvm-windows releases.
- Run the
.exefile and install it (default pathC:\Program Files\nvmis recommended). - Essential Commands (Run PowerShell as Administrator):
nvm -v
nvm install latest
nvm install 22.12.1
nvm use 22.12.1
nvm current
npm install -g @angular/cli
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
ng generate @angular/core:standalone
npm install -g @ionic/cli
ionic start myApp tabs --type angular
npm install @ionic/angular@latest
ionic serve
ionic build --prod
ionic build --configuration=production
ionic build -c=staging
ionic build -c=production -- --base-href=/app/ --source-map=false
npm init @capacitor/app@latest
npx cap add android
- A package.json
- A separate directory for built web assets such as dist or www
- An index.html file at the root of your web assets directory with tag in order to properly inject Capacitor
npm i @capacitor/core
npm i -D @capacitor/cli
npx cap init
npm i @capacitor/android @capacitor/ios
Once the platforms have been added to your package.json, you can run the following commands to create your Android and iOS projects for your native application:
npx cap add android
npx cap add ios
npx cap sync
ionic build
npx cap copy android
npx cap open android
ng add angular-cli-ghpages
ionic build --prod -- --base-href /YOUR_REPOSITORY_NAME/
npx angular-cli-ghpages --dir=www
- Enable Developer options on your mobile device
- Enable USB debugging
- Connect your device via cable and ensure Android Studio detects it (in the device list)
- In Android Studio, go to: Build > Build Bundle(s) / APK(s) > Build APK(s). This will generate an .apk file in the "app/build/outputs/apk/debug/" folder
- Once you have the APK file, copy it to your mobile device (using a USB-C cable in my case) and place it in the Downloads folder. Then, click to install the APK