I have several apps that currently rely on PhoneGap Build to create native apps for Andriod and iOS. It seems that Adobe is about to abandon iOS compatibility by failing to upgrade to the latest Cordova iOS version to meet Apple's requirements. It's time to move to CLI. I'm hoping that someone who'd done this before can provide some tips on how they did this. In particular, changes to workflow, handling keys and config.xml, etc.
Update 1: I've been making progress with an automated workflow and here's what I've learned so far (on MacOS):
- Loading Cordova is fragile. I had to search the internet several times to overcome problems in getting it all loaded.
- When creating a Cordova project directory, you should populate config.xml, res and www with your stuff before adding the ios and android platforms. Otherwise "cordova clean" breaks.
- If you use build.json, you must "cordova clean" if you change it before it will be used.
- Build for iOS, then open {cordovaDir}/platforms/ios/{proj}.xcworkspace in XCode, then load your certificates and provisioning profiles (select the top-level directory to get the General setting page). You'll have to turn off "Automatically manage signing" to set everything up.
- I could not get "Automatic" signing to work (see Cordova CLI 9.X docs). I used the manual process. Get the UUID by editing the provisioning profiles with a text editor and searching for "UUID".
- During the Cordova CLI build process, the code signer will ask you for your password multiple times. So much for automation. Is there any way around this?
Please let me know if I got anything wrong.
Update 2:
- When setting up iOS (manual) signing on a new project. You need to turn off "Automatically manage signing", set up your provisioning profiles, then quit XCode. Then reopen the xcworkspace file and turn on "Automatically manage signing". You need this last step in order for manual signing to work. You need to quit in between because, otherwise, XCode will not remember your provisioning profiles when you go back to "Automatically manage signing". Weird.
- When building an apk and ipa I found I had to enter my password manually 4 times. You have to give keychain access permission to automatically let the codesigner use your key in order to avoid this.
Update 3:
- I can't build a proper distribution build using "cordova build". It seemed to work, but Apple rejected the binary, citing the wrong profile. Fortunately, I can submit through XCode (using the exact same profiles and certificates set up manually in XCode) and Apple accepted it. This works for me right now. I like to record each ipa I send in, but I can export those through XCode. BTW, when building for distribution, uncheck including symbols. That seems to cause it to upload 1000's of MBs.
Update 4:
- The issue that prevented me from building a proper .ipa was that you need to specify both --release and --device on the cordova build command line. You'd think --release would do the right thing by itself, but no.
I can now submit properly. Thanks for the help!