# iOS TestFlight 通過 TestFlight,你可以在 App 發佈到 App Store 之前,輕鬆邀請用戶來測試你的 App 和輕 App,並收集他們寶貴的反饋。只需使用對方的電子郵件地址或通過分享公開邀請鏈接,你即可邀請多達 10,000 名測試員。 ## 前置步驟 需加入 [Apple Developer Program](https://developer.apple.com/programs/enroll/),99 美元/年,才能將 APP 送審上架 ## 發布 APP 流程 1. XCode > Product > Archive ![](https://i.imgur.com/QRP5mTM.png) 2. Distribute App ![](https://i.imgur.com/9zNOsUU.png) ![](https://i.imgur.com/qTkNwpC.png) ![](https://i.imgur.com/I4dFZP8.png) ![](https://i.imgur.com/DyTDvXy.png) ![](https://i.imgur.com/9A3ZSmU.png) 3. 上傳過程會檢查檔案若有任何錯誤可以在解決後重新編譯一次再上傳,錯誤相關解法可參考下方(遇到的各種問題),等到出現綠色大勾勾就代表你已經成功上傳到 App Store Connect 了。 ![](https://i.imgur.com/6xbBiLL.png) 4. 在上傳完成後並不是真正完成還需等待蘋果官方進行審核,約10分鐘就會收到審核結果,若審核不通過會收到信件(如圖),告知為何沒有通過;沒有收到信件即可進行下一個步驟啦~ ![](https://i.imgur.com/G3dYGkM.png) 5. 進入 [App Store Connect](https://appstoreconnect.apple.com/),你的 APP 就會顯示在那了 ![](https://i.imgur.com/HgF7Jmf.png) 6. 點擊 你剛剛上傳的 APP 並填寫必要資訊後就可以使用內部測試(<font color='red'>掛在同一個開發團隊的人可以進行測試</font>)了,未來若有新版本更新也可以直接讓內部測試人員進行測試,<font color='red'>不需要重新送審</font>。 7. 若要進行外部測試時需要在送審一次等待通過才可以讓外部測試人員進行下載,<font color='red'>每次有新版本更新皆需重新送審每次耗時1天以上</font>。 ## 內/外部測試 需從APP Store 下載 [testflight](https://apps.apple.com/tw/app/testflight/id899247664),下載完畢後點擊邀請連結就可以進行測試,若有任何版本更新也可以透過 testflight 進行更新不用在重新發送邀請。 ![](https://i.imgur.com/1GlwB1P.png) ### 內部測試 <font color='red'>掛在同一個開發團隊的人可以進行測試</font>,未來若有新版本更新也可以直接讓內部測試人員進行測試,<font color='red'>不需要重新送審</font>。 ![](https://i.imgur.com/UwCmIxP.png) ### 外部測試 最高測試上線人數為 10000 人,<font color='red'>每次有新版本更新皆需重新送審每次耗時1天以上</font>,且若有已經送審版本在尚未送審完畢的情況下不可以再送審一版(就算從外部測試移除也一樣)。 可以使用電子郵件、公開連結方式邀請相關人員進行測試。 ![](https://i.imgur.com/TOZssJy.png) ## 遇到的各種問題 ### 背景運行-BGTaskSchedulerPermittedIdentifiers Asset validation failed Missing Info.plist value. The Info.plist key 'BGTaskSchedulerPermittedIdentifiers' must contain a list of identifiers used to submit and handle tasks when 'UIBackgroundModes' has a value of 'processing'. For more information, refer to the Information Property List Key Reference at https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html. (ID: 46d4473c-567b-446d-b885-f412a94ab81b) #### 解法 ```xml <key>BGTaskSchedulerPermittedIdentifiers</key> <array> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> </array> ``` #### 參考資料 https://stackoverflow.com/a/59427369 https://github.com/fluttercommunity/flutter_workmanager/issues/105 ### 鎖 iPod 橫直屏 Asset validation failed Invalid bundle. The “UIInterfaceOrientationPortrait” orientations were provided for the UISupportedInterfaceOrientations Info.plist key in the yen.yen.yen.yen bundle, but you need to include all of the “UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight” orientations to support iPad multitasking. For details, visit: https://developer.apple.com/documentation/bundleresources/information_property_list/uisupportedinterfaceorientations. (ID: c56cba6e-f7bd-4676-9e2e-e7d78908508e) #### 解法 ```xml <key>UIRequiresFullScreen</key> <true/> ``` #### 參考資料 https://stackoverflow.com/questions/32559724/ipad-multitasking-support-requires-these-orientations/32728607#32728607 ### 需要相關權限但卻未列在 Info.plist 內,且權限相關描述不夠具體 ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “Runner.app” bundle should contain a NSSpeechRecognitionUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If your app supports multiple locales, you’re now required to provide a purpose string value in the Info.plist file in addition to a valid localized string across each of your app’s localization folders. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources. #### 解法 移除不必要的權限,並將需要的權限使用方式寫的更詳細 ```xml <key>NSCameraUsageDescription</key> <string>需要您使用相機的權限,以便您使用視訊功能</string> <key>NSFaceIDUsageDescription</key> <string>需要您使用生物辨識的權限,以便您能更快速的登入</string> <key>NSMicrophoneUsageDescription</key> <string>需要您使用麥克風的權限,以便您使用視訊及通話功能</string> ``` ## 參考資料 https://www.appcoda.com.tw/ios-app-submission/ ###### tags: `iOS` `Debug`