cocos2d-x v4项目创建iOS

下载文件后,解压到自己的文件夹,然后在cocos2d-x根目录,使用下面的命令,使用之前,需要先安装CMake

cd cocos2d-x
mkdir ios-build && cd ios-build
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos
open Cocos2d-x.xcodeproj

Create iOS simulator project
cd cocos2d-x

mkdir ios-build && cd ios-build

cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator

open Cocos2d-x.xcodeproj

2、安装CMake文件
下载地址:https://cmake.org/install/
设置环境变量
PATH="/Applications/CMake.app/Contents/bin":"$PATH"
sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

https://stackoverflow.com/questions/60594861/cocos2d-x-4-0-new-project-not-includes-xcodeproj-file

参考文件

https://github.com/cocos2d/cocos2d-x/tree/v4/cmake#generate-ios-project

https://docs.cocos.com/cocos2d-x/manual/zh/installation/CMake-Guide.html

推荐阅读更多精彩内容