LoginSignup
3
3

More than 5 years have passed since last update.

Xcodeの環境変数を利用してDLCコンテンツの参照パスをシミュレータと実機で変更する

Last updated at Posted at 2014-03-16

"Build Settings" -> "Preprocessor Macros" で環境変数を使って定義すればコード中で環境変数を利用できる。

SIMULATOR_DLC_PATH="\"$(SRCROOT)/../DLC/\""

シミュレータの場合は、先ほど定義したマクロを searchPath に追加する。

#if TARGET_IPHONE_SIMULATOR
    CCFileUtils::sharedFileUtils()->addSearchPath(SIMULATOR_DLC_PATH);
#endif

環境変数を利用すれば、シミュレータの中にシンボリックリンクを貼ったり、ユーザー定義ファイルを用意する必要はなくなる。

3
3
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
3
3