Mac上使用Cocos命令創(chuàng)建Cocos2d-x Lu項(xiàng)目
一、下載cocos2d-x 3.1.x 解壓到桌面
二、打開(kāi)終端,cd到 Desktop/cocos2d-x-3.1.x/tools/cocos2d-console/bin
三、創(chuàng)建Lua項(xiàng)目:
執(zhí)行命令:cocos new HelloWorld -p com.mx.org -l lua -d ~/Desktop
參數(shù)解釋:
cocos --> cocos2d-x 的命令行工具集
new --> 創(chuàng)建一個(gè)新的工程
HelloWorld --> 項(xiàng)目名稱
-p -->包名
-l -->開(kāi)發(fā)語(yǔ)言類型 cpp/lua/js
-d -->項(xiàng)目保存位置
Desktop --> 桌面
出現(xiàn)以下畫(huà)面即可:

屏幕快照 2017-11-22 下午4.14.28.png
此時(shí)桌面會(huì)有HelloWorld項(xiàng)目,在HelloWorld/frameworks/runtime-src/proj.ios_mac 里,會(huì)有 HelloLua.xcodeproj 項(xiàng)目,用Xcode打開(kāi)運(yùn)行即可