Using Unsigned Builds
For customers re-signing the application, we provide unsigned builds.
- Store your unsigned EMS Mobile App in a new or empty directory.
- Change the extension of the app to .zip. (e.g., IPhone.App-44.1.xxx-unsigned.ipa -> IPhone.App-44.1.xxx-unsigned.zip.)
- Un-compress/expand the new zip file.
Setting Custom Configuration
- Refer to Customizing Your Configuration Using config.json for details on building a configuration file for EMS Mobile.
- Replace the config.json file with your custom configuration (located as follows):
config.json (top-level file)
Re-Signing and Repackaging for iOS
Follow the steps below to re-sign and repackage for iOS.
1. Install Fastlane.
Using, sudo gem install fastlane on an administrative Apple computer.
If your Apple computer is already configured with these items, these steps may not be necessary.
- Login to https://developer.apple.com
- Download your Distribution provisioning profile
- Double click it to install it. This file should exist on your system:
- ~/Library/MobileDevice/Provisioning Profiles/<profile-guid>.mobileprovision
See Apple's documentation for installing and managing certificates and signing identities. When the certificate is installed successfully you should see iPhone Distribution: Your Company, Inc in your Keychain, with a private key.
Assuming you have:
- Fastlane installed on your Apple computer
- the cert & private key installed in Keychain
- the provisioning profile mentioned above in ~/Library/.../<profile-guid>.mobileprovision
...then you should be ready to re-sign the application. Before you proceed, change the following in the command below:
- Replace path/to/your/file.ipa with the real path to the ipa file
- Replace iPhone Distribution: Your Company, Inc with the appropriate signing identity on your machine
- Replace <profile-guid> with the actual GUID or name of the provisioning profile you intend to use
- Replace EMS-Resigned with the display name you with to use, or remove the parameter if you do not wish to rename the application
Note: Running these commands will overwrite the ipa file you designate. Make a copy first if necessary.
fastlane run resign \
signing_identity:"iPhone Distribution: Your Company, Inc" \
provisioning_profile:$HOME/Library/MobileDevice/Provisioning Profiles/<profile-guid>.mobileprovision \
(All on one line for copy/paste:)
fastlane run resign ipa:path/to/your/file.ipa signing_identity:"iPhone Distribution: Your Company, Inc" provisioning_profile:$HOME/Library/MobileDevice/Provisioning Profiles/<profile-guid>.mobileprovision display_name:EMS-Resigned
If you want a bash script that will do this, you can copy this into a file (e.g., resign_enterprise.sh):
IDENTITY="iPhone Distribution: Your Company, Inc"
fastlane run resign ipa:"$IPA" signing_identity:"$IDENTITY" provisioning_profile:"$PROFILE" display_name:$DISPLAY_NAME
Re-Signing and Repackaging for Android
- Re-zip all the extracted files from earlier
- Note that assets, res, and AndroidManifest.xml are top-level files in an .apk, so be careful to zip the right files
- This CLI command will zip all the files in the current directory into a new zip file in the parent directory:
- zip -qr ../ems-custom-44.1.xxx.zip ./*
- Give the new zip file an .apk extension
- e.g., myapp.zip -> myapp.apk
- Sign the new .apk file, for example:
jarsigner -verbose \
-sigalg $EMS_APK_SIG_ALG \
-digestalg $EMS_APK_DIGEST_ALG \
-storepass $EMS_APK_KEYSTORE_PASS \
-keystore $EMS_APK_KEYSTORE_PATH \
zipalign 4 $APK_TO_SIGN $APK_OUTPUT