LoginSignup
74
67

More than 5 years have passed since last update.

XCode8への移行でしたこと

Last updated at Posted at 2016-09-15

ハマリポイントとしては

  • 外部ライブラリはきっちりSwift2.3でビルドすることを指定する必要がある
  • Gym+Xcode8でのSigningの情報が少ない

という感じでした。

構成環境

  • CircleCI (OSX)
  • Xcode7.2 -> Xcode8 への移行
  • Swift2.2 -> Swift2.3 への移行
  • Cocoapods 1.0.1
  • Carthage 0.17.2
  • Fastlane 1.103.0
  • Gym 1.9.0

CircleCI

Xcode8 を使う設定

Fastfile に以下のように記述する

machine:
  xcode:
    version: "8.0"

Xcode

Swift2.3 を使う設定

Target -> Build Settings -> Use Legacy Swift Language Version を Yes に設定する

Automatically manage signing の無効化 (Gymで署名する場合)

Target -> General -> Automatically manage signing のチェックを外す。

せっかくの機能なので使いたいところだが、Gymが以下のエラーを吐くので一旦無効化

**** has conflicting provisioning settings. **** is automatically signed, but code signing identity iPhone Distribution: **** has been manually specified. Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.

エラーに従って設定してみてもエラーが解消されないため、一旦無効化した。(要調査)

Signingの設定 (Gymで署名する場合)

circle.yml に GYM_CODE_SIGNING_IDENTITY を指定していても、xcodeproj の設定情報が未設定もしくは指定と矛盾があったときに GYM がエラーを吐くため、以下を設定しておく。
- Code signing identity
- Provisioning profile

Provisioning profile はUUIDではなく名前を指定するようになったので、そちらを設定する。(再発行されても変わらないので地味にありがたい)

Cocoapods

Swift2.3 を使う設定

ライブラリ側がXcode8対応済みであれば何もする必要はないが、一つでもされてなければ次の記述を追加する

Podfile
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '2.3'
    end
  end
end

先述した Use Legacy Swift Language Version を YES にする作業をしている

Carthage

Swift2.3 でビルドする

carthage のコマンドを叩く際に以下のようにする

$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 carthage XXXX

Cathage 0.17 以降では以下のように記述できるようです。

$ carthage XXXX --toolchain com.apple.dt.toolchain.Swift_2_3

Fastlane

Gymが使用するToolchainをSwift2.3に設定する

gymを呼び出している箇所に、以下のようにtoolchain を追加する。

Fastfile
gym(
  scheme: 'XXXX',
  configuration: "XXXX",
  toolchain: "com.apple.dt.toolchain.Swift_2_3"
)
74
67
2

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
74
67