LoginSignup
22
22

More than 5 years have passed since last update.

Cocos2d-x V3.0 rc0をインストールしてみた

Last updated at Posted at 2014-03-21

ここからダウンロード

Download v3.0rc0 からどうぞ。
zipで落ちてくるので、てきとうなところに解凍しましょ。

プロジェクト作る

$ cd cocos2d-x-3.0rc0/
$ ./setup.py

android-ndk android-sdk ant の場所を聞かれるので、それぞれの場所を教えてあげましょう。

$ source ~/.bash_profile

bash_profieを反映します。
setup.py がパスを通してくれたようで、cocosコマンドが使えるように!

$ cocos new TestPj -p com.hoge.testpj -l cpp -d ~/Documents/

とすると新しくCocosプロジェクトを作成できます。

  • TestPj : プロジェクト名
  • -p com.hoge.testpj : Androidのパッケージ名
  • -l cpp : 言語 (cppluaが選べます)
  • -d ~/Documents/ : 作成場所

これで作成完了。

iOSで動かしてみる

$ cd ~/Documents/TestPj
$ cocos run -p ios

これだけ。iOSシミュレータが起動し、ターミナルにはログとか出ます。簡単になりましたなー。

Androidで動かしてみる

$ cd ~/Documents/TestPj
$ cocos run -p android

いけるかな?と思ったんだけど、ANT_ROOTが無ぇ!って怒られたので .bash_profile を編集しました。

export ANT_ROOT=/YOUR_PATH/apache-ant-1.9.3/bin
export PATH=$ANT_ROOT:$PATH

この2行追加して

$ source ~/.bash_profile

$ cd ~/Documents/TestPj
$ cocos run -p android

見事に動きました。簡単になりましたなー(2回め)。

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