Quantcast
Channel: @blog.justoneplanet.info
Viewing all articles
Browse latest Browse all 46

Mountain Lion上でCocoaPodsを導入する

$
0
0

メモ。

ln -s /usr/bin/gcc /usr/bin/gcc-4.2
sudo gem install cocoapods
pod setup
cd your_project
vim Podfile

以下のようにプラットフォームと使用するライブラリを記述する。

platform :ios,'6.0'
pod 'JSONKit','~> 1.4'

以下のコマンドでインストールする。

pod install

Podfileから特定のライブラリが削除されていれば、この時にライブラリが削除される。

ビルドできなくなる

以下の表示になってビルドが止まる。

library not found for -lPods

以下のコマンドでxcodeを起動すれば良い。

open your_project_name.xcworkspace/
  • your_project_name.xcworkspace
  • your_project_name.xcodeproj

libraryを入れるとビルドできなくなる

libraryを入れると以下のエラーが表示されてビルドできなくなる。

duplicate symbols for architecture i386

CocoaPodsで導入したライブラリと直接入れたライブラリが衝突している場合に起こる。直接入れたライブラリを削除する。

■PonyDebugger

サーバー

以下のコマンドでローカルのサーバーをインストールして動作させる。

curl -sk https://cloud.github.com/downloads/square/PonyDebugger/bootstrap-ponyd.py | python - --ponyd-symlink=/usr/local/bin/ponyd ~/Library/PonyDebugger

以下のコマンドで起動する。

ponyd serve --listen-interface=127.0.0.1

クライアント

vim Podfile

以下のようにライブラリを追記する。

platform :ios,'6.0'
pod 'PonyDebugger'

以下のコマンドでインストールを行う。

pod install

AppDelegate.m

#if DEBUG
#import <PonyDebugger/PonyDebugger.h>
#endif
PonyDebuggerがNotFoundでimportできない。

target header search pathsに$(inherited)を追記する。

#if DEBUG
    PDDebugger *debugger = [PDDebugger defaultInstance];
    [debugger enableNetworkTrafficDebugging];
    [debugger forwardAllNetworkTraffic];
    [debugger enableCoreDataDebugging];
    [debugger enableViewHierarchyDebugging];
    [debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9000/device"]];
#endif

ブラウザでlocalhost:9000/deviceにアクセスする。


Viewing all articles
Browse latest Browse all 46

Trending Articles