fastlaneでTestFlightへアプリをアップロードする - ArtefactGitHub/I_T_iOSPractice GitHub Wiki

◆ pilot(upload_to_testflight)

https://docs.fastlane.tools/actions/pilot/
fastlane を用いて、TestFlightテスターとビルドを管理するコマンド。

◆ Fastfile サンプル

desc 'Deploys the app to testflight'
  lane :test do |options|
    match(type: 'appstore')
    BuildForVisualStudio(build_configuration: "AppStore_Release")

    pilot(
        username: ENV['USER_NAME'],
        app_identifier: ENV['APP_IDENTIFIER'],
        skip_submission: false,
        skip_waiting_for_build_processing: true
    )
  end

◆ fastlane 実行

$ bundle exec fastlane test

◆ エラー対応など

Firewall 関連?の問題

# If you are using pilot via the fastlane action, add the following to your Fastfile
ENV["DELIVER_ITMSTRANSPORTER_ADDITIONAL_UPLOAD_PARAMETERS"] = "-t DAV"

Firewall 関連?の問題を解消するための設定。
"before_all"レーンなどに設定を記載して対応。
https://docs.fastlane.tools/actions/deliver/

"username"オプションの指定

To not be asked about this value, you can specify it using 'username'
Your Apple ID Username:

とターミナル上で入力を促されてしまうので、"username:~~"を指定して対応。

"Invalid Bundle Structure"

ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'PracticeOpenGL.app/libSystem.dll.dylib' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."

https://qiita.com/hkomo746/items/3f659f961a02ec8ceafd
https://www.b4x.com/android/forum/threads/invalid-bundle-structure-error-itms-90171.86530/
とあるが、自分のケースでは「Scheme」が "Debug" だとエラーになり、"Release" だと問題無かった。

"Redundant Binary Upload"

"Redundant Binary Upload. You've already uploaded a build with build number '1.0' for version number '1.0'. Make sure you increment the build string before you upload your app to iTunes Connect.

同一のビルドバージョンのアプリが既に存在しているのが原因なので、バージョンを変更してアップロードする必要がある。
基本 increment_build_number で問題無い。
直接指定する場合は、increment_build_number(build_number: "1.1") などで良さそう。
https://docs.fastlane.tools/actions/increment_build_number/

"increment_build_number" が使えない

Apple Generic Versioning is not enabled in this project.
Before being able to increment and read the version number from your Xcode project, you first need to setup your project properly

Visual Studio のプロジェクトでは "increment_build_number" が使えない。
Xcode プロジェクトじゃないとバージョンをインクリメンタル出来ない。
下記のようにして対応。

_build_version = get_info_plist_value(path: PLIST_FILE_PATH, key: "CFBundleVersion")
_new_version = _build_version.succ
set_info_plist_value(path: PLIST_FILE_PATH, key: "CFBundleVersion", value: _new_version)

※"1.0.0.9" の次は "1.0.0.10" にならず、"1.0.1.0" になるので注意。


◆ 「輸出コンプライアンスがありません」と表示され、テストが行えない

iTunes Connect の TestFlight ページで、ビルド情報に「輸出コンプライアンスがありません」と出るだけで、
テストまでの手続きが行えなくなった。
時間が解決したのか(提出から1時間以上経過)、新しいビルドをアップロードしたからか、
新しく AppStore 用のを提出したからなのか、何が影響したのか分からないが、
該当アイコンで「輸出コンプライアンス情報の提出」が出るようになった。
提出して「テスト中」にステータスが更新された。

アプリの設定で直接指定する。
↓ ↓ ↓
http://d.hatena.ne.jp/ishikawam/20170331/p1
直接 Info.plist に「ITSAppUsesNonExemptEncryption」を追加する、
Visual Studio 開き、下部の source タブで key-value で追加する、で対処可能。

※Xcode 上だと「App Uses Non-Exempt Encryption」で表示される。

⚠️ **GitHub.com Fallback** ⚠️