LoginSignup
17
13

More than 5 years have passed since last update.

CocoaPodsの導入メモ

Last updated at Posted at 2014-03-18

CocoaPodsのインストール

rbenv gemset使っているので、sudoはしない

gem install pod

Podfileの作成

projectファイルと同じ場所に、Podfileを作成する
CocoaPodsのXcode拡張を入れとくと便利かもしれない。

pods.png

Podfile
platform :ios, '5.0' # 明示的にバージョンを書かないと、4.3扱いになるみたい

pod "GoogleAnalytics-iOS-SDK",  '~> 3.0.3'

podsのインストール

Podfileの場所に移動して、pod install するだけ

overrides the ... 対応

インストールの際に、以下の警告が出たので対応する。

[!] The target `xxx [Debug]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `xxx [Release]` overrides the `GCC_PREPROCESSOR_DEFINITIONS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

おそらく、自分のプロジェクトのターゲットのbuild settingが、
Podsのターゲットのbuild settingを上書きしている模様。

自分のプロジェクトのbuild settingは弄りたくないので、
$(inherited)をHEADER_SEARCH_PATHSと、GCC_PREPROCEESSSOR_DEFINITIONSに追加した。

参考:

Git関連の設定

どのファイルをGitで管理して、どれをignoreに追加するのか?
とりあえず、bundlerと同じなら、PodfileとPodfile.lockのみ
リポジトリに追加して、他は全部gitignoreに入れれば良いはず。

GitHubにある、Objective-Cのgitignoreだと、CocoaPods関連はPodsのみ入っているので、そのまま利用した。

17
13
0

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
17
13