Skip to content
This repository was archived by the owner on Jul 9, 2019. It is now read-only.
James Baxley edited this page Jan 29, 2017 · 6 revisions

To build Holtzman for native devices, we use the launch tool. It is documented in depth here, but we will just go over the information pertinent to Holtzman in this wiki.

Whether you are building for alpha, beta, or production, all of the following steps will be the same, even though the variables may change.

1. Clean Up Environment

To ensure a clean build containing the code that you want, clean up your environment prior to doing a build.

rm -rf .meteor/local
rm -rf .build
rm -rf node_modules && npm install

2. Meteor Settings

Make sure you have the proper Meteor settings located at .meteor/settings.json. These settings are available in our private settings repo.

Some things to look out for, though not the exhaustive list of settings, are:

  1. Correct Google Analytics code
  2. Correct Heighliner url
  3. Private and public Rock tokens
  4. Environment specific settings (Hockey, Lookback, etc.)

3. Update Version & Build Info

Version and build numbers are tracked in mobile-config.js. There are 3 things you need to be aware of during building:

  1. App.info id
  2. App.info version
  3. App.info buildNumber

Unfortunately, our iOS and Android builds have different unique ids. This is because we created the Google Play application ourselves, but we transferred our iOS application from a third-party and inherited their unique id. For alpha and beta environments, you won't need to worry about this. But for production, you will need to do a separate builds for Android and iOS. It may be possible to change the IDs after build, but I normally just do two separate builds to be sure.

Google Play ID: cc.newspring.newspringapp Apple App Store Beta: cc.newspring.newspringapp Apple App Store Production: com.subsplashstudio31.NewSpring-Church

4. Install Launch

npm install -g meteor-launch

5. Launch Settings

Launch takes it's own set of variables for building and deploying the project. It is also available in the private settings repo, and should be copied locally to launch.json in the project root.

After copying, you should change the APPLE_ID attribute to be the email address associated with your Apple developer account. You should also add an attribute named FASTLANE_PASSWORD with your Apple ID password, or you will be asked to enter it every time you try to upload to TestFlight/App Store.

6. Apple Certificates

In order to sign the Xcode project, and generate an IPA file for upload, you should install the distribution.p12 certificate on your Mac. You can do this grabbing it from the private settings repo and double-clicking it, which should open the "Keychain Access" application. You want to choose the login keychain. The certificate placed in your keychain should contain a private key named "NewSpring App" if you click the down arrow.

7. Google Play Certificates

In order to sign the Android APKs for upload, you should copy the androidkey file from the private settings repo, and place it in your $HOME directory as .keystore. So, ~/.keystore.

8. Amazon Certificates

I'm not sure what the process for this is quite yet, but surely there are some certificates. Once obtained, make sure they are placed in the private settings repo, and add instructions for where to place them.

9. Build

The launch build command will build the project in to the .build folder in the project root directory, including:

  1. server tarball (.build/Holtzman.tar.gz)
  2. iOS project (.build/ios)
  3. Android project (.build/android)

Holtzman uses the environment variables NATIVE and WEB to distinguish between the two environments. It's possible to add this to your launch.json file, as launch passes through all of those variables as environment variables to the meteor build tool, but I recommend just prepending the launch command with the version you want. This will prevent confusion around which version is getting built.

You also need to pass the url that the native server will be deployed to, and the path to the settings file.

NATIVE=true launch build https://alpha-app.newspring.io .meteor/settings.json

CURRENT ANDROID ISSUE

Somewhere in the meteor build process, support for the Crosswalk web view when building as become inconsistent. There are open issues on the Meteor repo, but the launch issue is here:

https://github.com/NewSpring/meteor-launch/issues/102

Basically, the android APKs aren't always generated for some reason. You can get around this by running some additional commands:

rm .build/android/project/AndroidManifest.xml
mv .meteor/local/cordova-build/platforms/android/AndroidManifest.xml ./.build/android/project
./.build/android/project/cordova/build --release
mv ./.build/android/project/build/outputs/apk/project-armv7-release-unsigned.apk ./.build/android/project/build/outputs/apk/android-armv7-release-unsigned.apk
mv ./.build/android/project/build/outputs/apk/project-x86-release-unsigned.apk ./.build/android/project/build/outputs/apk/android-x86-release-unsigned.apk

...or, by just running the launch build command a second time. Hopefully, Meteor will be able to fix this issue, but if not we should add it in to the launch project to simplify things.

10. Signing

No additional steps are needed for the iOS project as launch will take care of the signing for you. But for Android, you need one more step:

launch prepare

This will take the APKs out of a deeply nested folder, sign and align them, and place them in .build/android for you.

Clone this wiki locally