Failed to get parent identifier for BUNDLEIDENTIFIER.

Recently have been working on this project just fine... had an app throw a warning for some malware called InstallCore. Removed the malware and now I am getting this on every preview, regardless of the device preview type.

I've tried clearing derived data, cache, etc. No dice.

Could not install the preview host "AppName.app" on iPhone 14 Pro Max: Failed to get parent identifier for BUNDLEIDENTIFIER. 
  • I encountered a similar error after migrating from one mac to another. In my case, I reinstalled simulator and after that everything works fine. Here is the solution:

    sudo killall -9 com.apple.CoreSimulator.CoreSimulatorServicesudo rm -rf ~/Library/*/CoreSimulatorgo to Window->Devices menu in Xcode then add the wanted simulators by taping the "+" button in the lower left corner of the window. (post)
Add a Comment

Replies

Two things to try:

  1. Double check the Info.plist in your DerivedData for the app you're building. Is there a key for the bundle identifier? If so, what is the value?
  2. Otherwise, this sounds like your Xcode install might be invalid. I know this is a lot of work, but could you try deleting and re-installing Xcode?
  • Bundle identifier in the Info tab shows to read $(PRODUCT_BUNDLE_IDENTIFIER). I am not too sure where to go to find the DerivedData folder, I usually just use an app called DevCleaner for that. What's weird is it's JUST the Xcode canvas previews that are causing the issue. Testflight builds, simulator builds, real device builds - all fine.

    If the Xcode install was invalid, would this issue be effecting all projects - not just this one single project?

Add a Comment

I encountered a similar error after migrating from one mac to another. I found a solution in another topic: xcrun simctl --set previews delete all After that, the preview was rebuilt and works fine.

I also encountered a similar error after migrating from one mac to another like @lenarsukhov mentioned. However, instead of having to run the xcrun simctl --set previews delete all command I just erased all content and settings in the simulator device menu and it fixed the issue for me.