LoginSignup
5
4

More than 5 years have passed since last update.

cocos2d-x 3.2の新規プロジェクト生成時にiOSのBundle Identifierを設定する

Last updated at Posted at 2014-11-27

どうも、マキシの人です。
cocos newでプロジェクトを作成する時に、
"org.cocos2dx.hellocpp"ってBundle IDが設定されてて、
Xcodeから手作業で直してたのでちょっとおかしいと思ってまして・・・

cocos new コマンドのオプションにありました。

$ cocos new TestGame -p com.maxigundan.TestGame -l cpp --ios-bundleid com.maxigundan.TestGame

これで問題ありませんでした。

Webで調べてみたら、
あまりこの記事が見当たらなかったので、
今一度情報共有してみました。
いちいち入力が面倒なので、以下のようなシェルスクリプト作ってもいいですね。

makeproject.sh
#!/bin/bash
CMPREFIX=com.maxigundan.
if [ $# -ne 1 ]; then
  echo “usage: this.sh GameName” 1>&2
  exit 1
fi
GAMENAME=$1
GAMEPKG=$CMPREFIX$1

cocos new $GAMENAME -p $GAMEPKG -l cpp --ios-bundleid $GAMEPKG

ではでは。

↓cocos new 参考

usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]
                 [-t TEMPLATE_NAME] [--ios-bundleid IOS_BUNDLEID]
                 [--mac-bundleid MAC_BUNDLEID] [--no-native]
                 [PROJECT_NAME]
5
4
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
5
4