LoginSignup
14
10

More than 5 years have passed since last update.

Xcode 9 + fastlaneでもManualでipaを作る

Last updated at Posted at 2017-10-30

Xcode 9で配布用証明書Provisioning Profileのみでipaを作ろうとした時に無事死亡したので解決方法を残します。

Xcode 8でのAutomatically manage signingに負けないfastlaneでのiOSアプリ配布を元に作成していますので、細かな部分はそちらを参考にしてください!
ipaを作りたい!というタイトルですが、DeployGate等でアプリ配布も可能です。

環境

  • Xcode 9.0.1
  • fastlane 2.62.1

Automatic Code Signingオフができない!

オンオフの切り替えしても変わってくれない(´・ω・`)
fastlane action disable_automatic_code_signing(path: "Project.xcodeproj") not working

解決方法

fastlaneで切り替えをしない!

Xcode 9からCode Signing Styleを設定できるようになっていました。(全然知らなかった。。)
Manualにしておけばfastlaneで変えなくて良くなります!

Build SettingManualに設定します。
スクリーンショット 2017-10-30 11.41.01.png

エラーとの遭遇

app作成は成功し、その後のxcrunでエラーが出ます。

エラーの関係箇所ログ抜粋

Generated plist file with the following values:
▸ -----------------------------------------
▸ {
▸   "provisioningProfiles": {
▸     "": "hoge adhoc"
▸   },
▸   "method": "ad-hoc"
▸ }
▸ -----------------------------------------

Error Domain=IDEProvisioningErrorDomain Code=9 ""プロジェクト名.app" requires a provisioning profile with the Push Notifications feature." UserInfo={NSLocalizedDescription="プロジェクト名.app" requires a provisioning profile with the Push Notifications feature., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

エラーの解決方法

provisioningProfilesがうまく設定されていないようなので、gymexport_optionsオプションを指定します。参考

gym(
  export_options: {
    provisioningProfiles: {
      "com.example.hoge" => "hoge adhoc"
    }
  }
)

他のオプションも記載されていますが、私の環境では最低限上記が設定されていればipaができました。
com.example.hogehoge adhocは適宜読み替えてください!

まとめ

Xcode 9対応の変更は下記の2点のみでした。

  • Code Signing Styleの設定
  • gymexport_optionsのオプション指定

Xcode 9からCode Signing StyleができてFastfileも若干スッキリします。
export_optionsのほうはそのうちfastlane側で対応されそうな気がしますね!

14
10
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
10