Please install node v14.17.2 or above via nvm.
- Install ionic cli
- npm install
- Add the environment files corresponding to the build you want in the environment folder
- ionic serve -c
env_name
- go to .git/hooks
- run in the shell - chmod +x pre-commit
- Note: It is to prevent keys from accidentally leaking.
- Ping mobile app team for environment files
- Add them inside the environments folder
- Note: Do not make any changes to the environment.ts file - this is a template folder for creating configurations.
- Ping mobile app team for write access to the repository
- ionic capacitor run android -l --external --configuration=staging
It will open android studio, let it build index file and Gradle build for sometime
Then check that studio recognized the right device in the top bar. Press the run button. After every change, you make in the
src
directory. It will automatically build the app on the device.
- Add .env file to project (ping mobile app team for the file)
- Install Xcode from App store
- run ionic build --staging
- npx cap sync
- npx cap open ios
- In Xcode, select the connected device from the top bar and click on run button.
iOS
- Add this line
ios/App/Podfile
file (open via code editor, not xcode)- (After this line -> # Add your Pods here)
- pod 'FirebaseCore'
- pod 'Firebase/Messaging'
- (After this line -> # Add your Pods here)
- Run this from terminal
- npx cap update ios
- Add these lines
ios/App/App/AppDelegate.swift
file- (After this line -> import Capacitor)
- import FirebaseCore
- import FirebaseInstanceID
- import FirebaseMessaging
- FirebaseApp.configure() (After this line -> // Override point for customization after application launch.)
- Update the application_ function after #if USE_PUSH as described below
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { Messaging.messaging().apnsToken = deviceToken InstanceID.instanceID().instanceID { (result, error) in if let error = error { NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidFailToRegisterForRemoteNotificationsWithError.name()), object: error) } else if let result = result { NotificationCenter.default.post(name: Notification.Name(CAPNotifications.DidRegisterForRemoteNotificationsWithDeviceToken.name()), object: result.token) } } }
- Now open Xcode and enable Push notifications from sigining and capabilites if it is not enabled.
- Follow these two articles if you face any issue
- (After this line -> import Capacitor)
- Click on Actions Tab
- From Workflows List, Select
Manual Workflow - Appflow
- On the right hand side you can see the list of workflow run.
- In the list view you can see a
Run Workflow
button. Click on that button - Select the branch on which you want to run the workflow from the dropdown available for
Use workflow from
- Click on
Run Workflow
- This will now run the workflow on your private branch and the diawi apk link and ipa links will be shared on slack
Some common issues and how to fix them
This happens because some packages listed in package.json
are not installed locally. Delete node_modules
and run npm i
to fix this issue.