How to take iOS build in CMake(3.16.2) of Cocos2d-x-4.0

How to take iOS build in CMake(3.16.2) of Cocos2d-x-4.0


I’am facing a issue in taking new iOS build in Cocos2d-x-4.0, where i’am using CMake(3.16.2) also.
Xcode(10.1) is the code editor.

Usually we used to take debug build in the Xcode interface itself, now am not even getting list of simulators when I started to use Cocos2d-x-4.0

Please do come up solutions, So thanks in ADVANCE.

Thank You.

The command to create iOS project provided is not getting executed, as here and out of that initial 3 commands are working fine.Screenshot 2020-01-09 at 7.54.07 PM

But fourth command open Cocos2d-x.xcodeproj is not working as there is no Cocos2d-x.xcodeproj file.

How can I generate Cocos2d-x.xcodepro file ?

The cocos2d-x v4 build fails. Initially below commands are used

cd cocos2d-x
mkdir ios-build && cd ios-build
cmake … -GXcode -DCMAKE_TOOLCHAIN_FILE=…/cmake/ios.toolchain.cmake
open Cocos2d-x.xcodeproj. -> Even this is giving error.

Then even build is also not supported.

Please do give a solution !

Thank You. :slightly_smiling_face:

Can you please show all your steps, start to finish. You did use cocos new ... to create a new project?

Here is a guide for you reference.
../cmake/ios.toolchain.cmake was removed and use cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS instead.

1 Like

I use:

cocos new MyGame -p -l cpp -d ~/MyGame
cd ~/MyGame
cocos compile . -p android
cocos compile . -p ios
cocos compile . -p ios -sdk iphoneos

The cocos compile steps above may produce various errors & fail to make a full build (eg the last iphoneos one fails due to signing required) but you can then open an IDE on a valid project & fix those issues.

1 Like

after running above commands(cocos compile . -p ios).
I’am getting below issue.Screenshot 2020-01-20 at 7.02.27 PM

@Sumanth_kumar Don’t you need to run v4 apps on hardware? The iOS Simulator doesn’t support Metal.

@slackmoehrle The iOS simulator can support metal which require running macOS 10.15 or later and running Xcode 11 or later.
@Sumanth_kumar @sarah_jane_smith I will take a look.

Thanks, I am not on 10.15 on my work laptop yet! Perhaps I need to upgrade soon.

@Sumanth_kumar It build succeed in my local device. Please make sure you are running macOS 10.15 or later and running Xcode 11 or later if you want the metal app run in the simulator.

1 Like