Cannot run application on simulator after installing Xcode 11 - CFBundleVersion error
There is a lot of misinformation in the answers here, so I wanted to provide an authoritative response.
The issue here is that the new version of CoreSimulator.framework with Xcode 11 beta does validation on CFBundleVersion that previous versions did not do. These checks are valid, and it does represent an issue in your application, but there's also a bug in how the checks were performed in Xcode 11 Beta 1 which compounds the issue.
First, fix the CFBundleVersion in your Info.plist. It should consist of only numbers and up to two periods (ie ##.[.##[.##]], eg: 12.4.2).
Second, after fixing CFBundleVersion, you need to killall -9 CoreSimulatorBridge
because the old value is unfortunately cached in CoreSimulatorBridge, preventing it from recognizing the new value. This part was a bug, and it was addressed in Xcode 11 Beta 2.
Happened to me too, wasted almost an entire day scouting for possible causes.
The steps that finally fixed the problem and allowed me to install on simulator:
- Quit Xcode and iOS Simulator
- Remove
/Library/Developer
(the one from root), or rename it if you want to keep a backup - Relaunch Xcode, agree with the installation of command line tools
- Continue work where you left over :)
Besides the steps mentioned in the question (fully uninstall Xcode 11, fully uninstall Xcode 10 and reinstall it afterwards), I also tried cloning the project in another location, circulating through all possible locations for derived data, installing other simulator runtimes and trying on those. None of them worked, luckily the console log app shown the path for the process that rejected the app bundle, it was one of the binaries installed by Xcode in /Library/Developer/PrivateFrameworks/CoreSimulator.framework
.
Seems that Xcode 11 installed a newer version of the frameworks, and Xcode 10 was not overwriting them. Removing the whole /Library/Developer
folder triggered the command line tools installation, which finally brought back the simulator runtime that properly worked in Xcode 10.
You gotta love the betas :)
I had the same problem. I find the Xcode 11 Beta Release Notes had explain it.
Bundles without a CFBundleVersion are invalid and can’t be properly installed on
devices or simulators. CoreSimulator now checks and rejects such bundles earlier in
the process with a clearer error message. (49892531)
And this link is the format of CFBundleVersion.
When I resolved this problem, I found out if having the CFBundleVersion problem when running App for the first time. Then it always has problem no matter whether the format is correct or not. So I restart the Xcode and the Simulator, and change the CFBundleVersion to a correct format, the App running correctly.