Can't load iOS app on phone, invalid Info.plist

I used CMake to generate a Makefile and build for iOS using that.

This creates a .app file, but if I try to load it onto my phone I get this error message:

Screen Shot 2022-11-12 at 6.07.26 pm

Even if I give a value to CFBundleExecutable in the plist file, it still shows the same error. I can also verify that the plist has this value by right clicking the .app file and clicking “Show Package Contents”. Inside the Contents folder is a plist file that has the correct value:

<key>CFBundleExecutable</key>
<string>MyGame</string>

I’m on macOS Monterey version 12.6, with cocos2d-x version 4. My phone is on iOS 16.1.1. I’m using Xcode version 14.1.

What’s going wrong here?

I found a fix. Instead of just using

cmake ..

I used

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

Then I built the app from the generated Xcode project. I’m able to get my game on iOS with no problems now.

I can’t post links to this forum, but I found this solution in the “CMake Guide” page in the v4 documentation.