APP 送審自動化 - PC Lin 林培鈞
===
{%hackmd FGRWt1UuTFKk0wSbGgg-SA %}
###### tags:`iPlayground2019`
[投影片](https://drive.google.com/file/d/12P8bvPv1cT1e6WaSrMY_Drl1jSwM0jBG/view)
## YouTube
{%youtube ZDgFoqw01P4 %}
## 送審大量 iOS App 面對的難題
* Code signing 相關問題要如何處理?
* 如何使用有效率產出 IPA ?
* 如何有效率的送審 App ?
# * Apple 到底埋了多少坑等著開發者們去踩?
* 上面的步驟要如何節省時間 ?
## 處理單一 App 注意事項
* Apple Developer Portal
* xcodebuild
* IPA upload
* App Store Connect
### Code Signing
* Private Key
* Certificate Signing Requests
* Distribution Certificate
* Provisioning Profile

### Validation Chain
* Signed App installed on the device
* Signed App trusted by the developer
* The developer is trusted by Apple
* The device trust Apple
### Build Validation

### App Launch Validation
note: `picture miss match`
### App ID
* Bundle Identifier
* Capabilities
### Distribution Certificate
* Created with CSR
* Paired with Private Key
* Expire in 1 year
### Provisioning Profile
* Bind with Bundle Identifier
* Expire in 1 year
* Copy to `~/Library/MobileDevice/Provisioning\ Profiles/`
* Include Information
* App ID
* Capabilities
* Team ID
* Profile Name
### APN Service
* Push Notification
* Push Key
### xcodebuild
* Xcode Toolchain
* Command line tool
* Build iOS App Store Package (IPA) process
* xcodebuild ~archive
* xcodebuild ~exportArchive

### ⛔ Build Fail!
* Expired Certification/Provisioning Profiles
* Certification does not pair woth Private Key
* The Certificate in Provisioning Profile does not exist
* Multi-certificate from same developer team installed in Keychain Access
* Enabled Capabilities in Provisioning Profile and Entitlements not match
### IPA Upload
* Appplication Loader
* macOS only GUI tool
* Deprecated in Xcode 11
* altool
* macOS only command tool
* xcrun altool
* iTMSTransporter
* Suppoerts: macOS, Windows, and Linux
* Java gased command line tool
* Upload digital contents to iTunes Sotre, Apple Books and App Store
### ⛔ Upload Fail !!
* Apple account and Apple ID not match
* Build version is equal to or less than live version
* Same build version and build number
* Processing fail
* Bundle Identifier collision
* Incorrect IPA content
### Upload to Testflight
* App processing time: at least 20-30 mins
* Build version & build number
* Expires in 90 days
* Export compliance information
## 處理大量 App 注意事項
* Build time optimization
* Two-Factor Authentication
* App Rejected
* Review Guildline
* License Agreement
### Build time optimization
* Reduce total compile time
* Re-sign IPA
### Two-Factor Authentication
* Must be enabled by "Account Holder"
* Automation tools will be interrupted

### Review Guideline
* Metadata Reject
* Binary Reject
* Commercial Template
* Latest Apple
### Renew License Agreement

### Process Analysis

### Automation Tool
* Jenkins
* Spaceship
* App Store Connect API

### Containerize Services

### Automate Flow
1. Code signing
2. App build process
3. IPA upload
4. App submit
5. App status