cocos2d-x 3.x Mac環境下搭建, 建立Xcode項目,cocos2d-xxcode

來源:互聯網
上載者:User

cocos2d-x 3.x Mac環境下搭建, 建立Xcode項目,cocos2d-xxcode

最近比較閑..折騰一下cocos2d-x 3.x系列。

雖然出來很久了,不過一直沒時間學習。之前一直用著2.14版本。


cocos2d v3.x 版本出來後,從配置安裝到建立項目都是命令列,下面簡單說一下.


1.    http://cn.cocos2d-x.org/download/   (目前最新版本3.3   375M左右)


2. 下載完成解壓後, 開啟終端, 進入到對應檔案夾。

比如我的:

 cd /Users/apple/Desktop/Colin/Cocos2d-x/cocos2d-x-3.3/

再執行 
./setup.py

如下:



期間會有幾次詢問,是設定安卓SDK路徑的,不設定安卓直接Enter跳過即可

 ->Please enter the path of NDK_ROOT (or press Enter to skip): ->Please enter the path of ANDROID_SDK_ROOT (or press Enter to skip): ->Please enter the path of ANT_ROOT (or press Enter to skip):

之後就OK了,會有提示:

Please execute command: "source /Users/apple/.bash_profile" to make added system variables take effect

照著輸入  source /Users/apple/.bash_profile 就好了


3. 準備建立工程

進入指定檔案夾。比如我的:

cd /Users/apple/Desktop/Colin/Cocos2d-x/cocos2d-x-3.3/tools/cocos2d-console/bin/

如果是緊接著前兩步, 直接輸入  cd tools/cocos2d-console/bin  即可。 (因為當前就在cocos2d-x-3.3目錄下)

接著使用下面命令即可:

cocos new 工程名 -p 包名 -l 語言 -d 目標檔案夾

比如我的:

./cocos new HelloWorld -p com.history.HelloWorld -l cpp -d /Users/apple/Desktop/Colin/Cocos2d-x/WorkSpace



然後就會在對應路徑下建立工程。




之前說過,如果不需要配置 android環境,跳過即可。

如果需要配置,可以參考以下教程:

Mac環境下Cocos2d-x開發環境完全指南


Cocos2d-x 3.x 全平台新手開發配置教程


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.