From e2b6779012a9a3ad016ee566565065b55131aca7 Mon Sep 17 00:00:00 2001 From: Bertrand Presles <bpresles@gmail.com> Date: Tue, 4 Jun 2019 22:28:18 +0200 Subject: [PATCH] Added instruction to build IPA and upload to Apple Store Connect through command line --- config.xml | 2 +- doc/build_ios.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 +- 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/config.xml b/config.xml index b680f9f1..d83ff461 100644 --- a/config.xml +++ b/config.xml @@ -107,6 +107,7 @@ </edit-config> </platform> <engine name="android" spec="^6.2.3" /> + <engine name="ios" spec="^4.5.5" /> <plugin name="cordova-plugin-camera" spec="^2.4.1" /> <plugin name="cordova-plugin-console" spec="^1.0.7" /> <plugin name="cordova-plugin-device" spec="^1.1.6" /> @@ -124,5 +125,4 @@ <plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git"> <variable name="CAMERA_USAGE_DESCRIPTION" value=" " /> </plugin> - <engine name="ios" spec="~4.5.5" /> </widget> diff --git a/doc/build_ios.md b/doc/build_ios.md index 29e18c38..1d8535b0 100644 --- a/doc/build_ios.md +++ b/doc/build_ios.md @@ -102,7 +102,7 @@ ionic state reset ionic run ios ``` -6. Build binaries : +6. Build binaries for emulator : ```bash ionic build ios @@ -111,4 +111,54 @@ ionic build ios ## Publishing to Apple store -- Follow this steps (section `iOS Publishing`): https://ionicframework.com/docs/v1/guide/publishing.html \ No newline at end of file +### Pre-requisite + +Ensure you have a valid Certificate (with your private key) +and Distribution Provisioning Profile associated to it in the OSX Keychain. + +See: https://help.apple.com/developer-account/#/devbfa00fef7 + +### Archive and upload to Apple Store Connect + +1. Prepare for iOS in release mode: + +```bash +ionic prepare ios --release --prod +``` + +2. Generate archive for iOS generic device +```bash +cd platforms/ios +mkdir build +xcodebuild -workspace Cesium.xcworkspace -scheme Cesium -sdk iphoneos -configuration AppStoreDistribution archive -archivePath $PWD/build/Cesium.xcarchive +``` + +4. Create an `export.plist` file with the following content +```xml +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>method</key> + <string>app-store</string> + <key>teamID</key> + <string>YOUR_TEAM_ID</string> +</dict> +</plist> +``` + +Replace `YOUR_TEAM_ID` by the Team ID associated to your Apple Developer Account (see Membership section on https://developer.apple.com/account/) + +3. generate IPA for Apple Store +```bash +xcodebuild -exportArchive -archivePath $PWD/build/Cesium.xcarchive -exportOptionsPlist $PWD/export.plist -exportPath $PWD/build +``` + +4. Upload to Apple Store Connect: +```bash +/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool --upload-app -f "CLI.ipa" -u YOUR_APPLE_ID +``` + +The prompt for your password, if you use two-factor authentication, you'll need to generate an application specific password for this command (see: https://appleid.apple.com/account/manage) + +5. Go to `https://appstoreconnect.apple.com/`, then `My Apps` and publish your App from there. \ No newline at end of file diff --git a/package.json b/package.json index ddcffd15..40f80a68 100644 --- a/package.json +++ b/package.json @@ -151,4 +151,4 @@ "ios" ] } -} +} \ No newline at end of file -- GitLab