Simulating iOS app - missing bundle ID but it is present in Info.plist

I have a desktop app which I’m trying to port to mobile, currently focussing on iOS.

I’ve followed the instructions for Building for iOS using CMake:

cmake -Bbuild-ios -DCMAKE_BUILD_TYPE=Debug -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=15.0
cmake --build build-ios -- -sdk iphonesimulator -allowProvisioningUpdates

The build succeeds but then I’m unable to install the app bundle on the simulator device.

I boot a simulated device with:

xcrun simctl boot <device-id>

with a device ID obtained from xcrun simctl list, and I can see the device has booted by running xcrun simctl list again.

But then when I try to install the app with:

xcrun simctl install booted build-ios/MyApp_artefacts/Debug/Standalone/MyApp.app

I get the following output:

An error was encountered processing the command (domain=IXErrorDomain, code=13):
Simulator device failed to install the application.
Missing bundle ID.
Underlying error (domain=IXErrorDomain, code=13):
	Failed to get bundle ID from <path-to-project>/build-ios/MyApp_artefacts/Debug/Standalone/MyApp.app
	Missing bundle ID.

However when I open the Info.plist file in the bundle, I can see the bundle ID is there:

<key>CFBundleIdentifier</key>
<string>com.MyCompany.MyApp</string>

Am I missing something here?

I’m doing this in terminal with the aim of scripting it, but I get the exact same errors if I go through the “normal” process of pressing Run in Xcode after the first cmake command above.

Thanks in advance for any help!

I can’t say I’ve seen this before. Do you see the same thing if you try to build the DemoRunner for iOS using CMake? That’s definitely worked for me in the last week or so.

A couple of thoughts:

  • Are you signed into Xcode using your Apple account? If not, try signing in before building again.
  • Are you building on an Intel or Arm mac? From memory, if you’re building/testing on Intel, you might need to force CMAKE_OSX_ARCHITECTURES to x86_64;arm64 to ensure that your binary is compatible with the simulator as well as physical devices.

The DemoRunner example works. Builds as expected and I’m able to install and launch it in the iOS Simulator.

I am signed into my Apple account in Xcode, and building on an ARM Mac.

Looking through my project’s CMakeLists and comparing it to the DemoRunner’s, one difference I noticed was that I’m using juce_add_plugin with a FORMATS Standalone argument rather than juce_add_gui_app. Did this to save dev time as I already had a plugin (also building standalone) project up and running. Would that cause any strange behaviours?

I’ve just whipped up a quick main.cpp file to glue my project with a gui app-style target to test it, but I’m still getting the same ‘Missing bundle ID’ error even though it’s there in the Info.plist.

That should be fine, the normal way to bundle a standalone and AUv3 plugin together for installation on iOS is to set FORMATS Standalone AUv3.

If I configure the main JUCE repo with -D JUCE_BUILD_EXAMPLES=ON then build the AudioPluginDemo_Standalone, I’m able to install it to the simulator using the commandline you shared.

Is there anything unusual about the bundle identifier itself? Could you try with a different identifier as a sanity check?

Yes, if I run cmake with -DJUCE_BUILD_EXAMPLES=ON I can build, install and run the AudioPluginDemo_Standalone as well.
So JUCE, the build toolchain, and the simulator all work, which is reassuring!

I just tried with the identifier “com.Company.Example” but still getting the same error.
The actual identifier I’m using is 33 characters long, contains only ASCII alphabetic characters (other than the two .) and is a mixture of uppercase and lowercase.

Solved!

Turns out it was an issue with how I was copying files into the bundle.
My guess is a weird codesigning quirk.

Previously I was copying all the app’s GUI assets into the app bundle directly post-build via add_custom_command. I’ve now switched to using juce_add_bundle_resources_directory in the CMake API and all is working as expected.

1 Like