Android studio is needed to add all the necessary build tools and sign the APK file. Make sure to add the path variable to your shell config. You will need to confirm that the android build tools that you have installed via Android Studio SDK tools, exist at the paths specified. Paths may change.
The command line tool to build, deploy and manage Cordova-based applications. Apache Cordova allows for building native mobile applications.
TODO: Add commands to use when troubleshooting cordova platform issues
Setting Up Files
TODO: Add steps for SSH/ troubleshooting Clone repo with SSH
git clone firstname.lastname@example.org:cxtsoftware/nxt.git
Navigate to the directory of the repo
TODO: Add the rest of the lines where version needs to be upgraded and screenshots
Test run android build
ionic cordova build platform android
It is good practice to make sure that the build will successfully compile first, also this will generate the debug.apk file that you will need to upload. Once the build is finished you can locate the apk file at the path that is specified in the terminal
Take the APK file and move it somewhere out of the directory where you can grab it later. I like to setup an automated rule using automator to move the file to a directory where it is easily accessible you can also like that directory to your google drive for convenience.
TODO: Optional add steps for automating xfer to QA
Again grab the APK file and move it to your collection. This is the Unsigned APK, you will need to sign this with Android Studio in order to submit it to the Google Play Store
TODO: Add screenshots for android studio 1. Open Android Studio and select the path to yours platforms folder: ~/nxt/platforms/android
2. Click on the path once it is added to the projects and launch the editor, if you notice in the bottom right there are some actions being taken, indexing, installing different dependencies. Allow this to finish before doing anything else. Also, when any prompts for dependencies ask for upgrading in Android Studio accepting the upgrades could cause potential issues in the build and with other plugins.
3. On the app menu click “Build” > “Generate Signed Bundle APK.
4. On the pop up tick the APK bubble > Next.
5. The “Keystore Path” can be located in the root of the nxt project.
6. For the key alias you can open the folder and chose the default alias. Key store password and the Key password are the same. See 1Password for the credentials. 7. On the next dialog select the “Release” option and click Finish
8. You can view the progress in the bottom right of the editor, when the build is finished you will see a pop up indicating that the APK was generated successfully. You can click the “Locate” link to navigate to the directory. Grab this file and put it in your collection.
Run the android release build for the unsigned.apk file
This file is requested by certain customers as they may use Mobile Device Managers for their drivers, product is instructed to provide the unsigned.apk to certain customers on each release.
Building the iOs Release TODO: Screenshots
Again, good practice to make sure that the build will successfully compile first. The iOs build is notoriously finicky, due to Xcode. Sometimes it can fail for seemingly no reason. You may have to run the build a few times. See Google for any errors that are returned.
Common Troubleshooting Steps
Remove and Re add the iOs platform
ionic cordova platform remove ios
ionic cordova platform add ios"
2. Delete node_modules folder then npm install
3. List all cordova plugins and remove them and reinstall
cordova plugin -l | xargs cordova plugins rm
4. List all plugins and remove them one by one
cordova plugin ls
cordova plugin remove <PLUGIN_NAME>
5. Individually re add the plugins back to the list
cordova plugin add <PLUGIN_NAME>
Building IPA to be signed
ionic-cordova-build --release --prod
This will build the unsigned IPA file and generate it to the following path:
Add this to your collection as well as some customers have requested the unsigned version.
Open XCode, and again you might need to select the path to yours platforms folder:
It is good practice to let XCode finish its indexing and processes before taking any further steps. At the top of the XCode app you will see when the status is ready to build by the counter on the top right of the app.
Navigate to Product > Archive.
Locate the built app in the top of the archives window
Click the “Validate app” button. This will validate the app to confirm that it is able to be uploaded to the app store. This part is important because if you don’t validate the app first, and then attempt to distribute the app and a failure were to occur, then you will be unable to submit the app with the same version number, Which means that you will have to rebuild the android app as well, bump the version number, create a new release ticket, etc.
Leave the default options selected, Next.
Select “Automatically Manage Signing”, Next.
Once you get to the review screen click “Validate”.
The app will be signed and verified this could take a few minutes, wait for this to complete.
Once this is finished, click Done. You can now close Xcode.
TODO: iOs Release Build process & suggested troubleshooting and commands TODO: Provide screenshots and link to 1pass along with any shell config/commands defaults needed for this
Note: This is a custom solution that was put in place to provide this file to customers, this isn’t supported by Xcode or Apple. If this doesn’t function at some point it may no longer be possible or a new solution might need to be found. You will also need to add the alias to your preferred shell config file.
This alias will run a sequence of commands that will generate an unsigned version of the IPA file. Once this has been generated you can add the file to your collection for upload. Path: