Xcode crash when start

I reinstall macOS system to monterey and restore from a higher version (sonoma), the xcode (version 15.4 on sonoma) can not run, so I delete it and reinstall xcode 14.2, but it always crash when start.

here is the error log when I start it in Terminal:

command:

/Applications/Xcode.app/Contents/MacOS/Xcode

error log:

Error loading required libraries. If there is an ongoing installation please wait for it to complete. Otherwise reinstall. (dlopen(@rpath/libIDEApplicationLoader.dylib, 0x0001): Symbol not found: (_$s10Foundation10CocoaErrorV13userCancelledAC4CodeVvgZ)
  Referenced from: '/Library/Developer/PrivateFrameworks/CoreDevice.framework/Versions/A/CoreDevice'
  Expected in: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation')
[1]    80496 abort      /Applications/Xcode.app/Contents/MacOS/Xcode

I have tried to remove some xcode related folders ~/Library/Developer, but it still not work.

Thanks for the post, and my apologies for the delay. Could you please post the complete crash log? It seems like you updated macOS to the latest version. Have you also updated Xcode to the latest version of Xcode 15.4? It appears that you are running an older version of Xcode.

Could you provide a simple, minimal, focused project that I can use to reproduce the crash?

The error message you see indicates that the Xcode application is facing an issue loading the CoreDevice framework, which is causing libIDEApplicationLoader.dylib to fail to load. This can happen if there is an existing installation of Xcode or some other related component running or in an unstable state.

Here are some troubleshooting steps you can follow to resolve this issue, please make sure first to use the latest version of Xcode.

  1. Wait for any ongoing installation to complete: As the error message suggests, ensure there are no active installations of Xcode or any related tools running. Wait for any background processes to end.

  2. Check for conflicting installations: Look for any incorrectly installed or partial installations of Xcode or its components. You can try:

    • Quit all Xcode-related applications: Including Xcode, Xcode Simulator, Instruments, etc.
    • Open Terminal: And run the following commands line by line:
        pkill -f Xcode
        pkill -f Simulator
        rsync -a --delete ~/Library/Developer ~/.Trash/
       sudo rm -rf /Library/Developer
       
* This will delete all Xcode-related working copies. Before running the sudo command please be sure to backup all your data if needed.
  1. Reinstall Xcode: Use the Mac App Store to reinstall Xcode. Make sure to download the latest version available.

    • Update: Go to the  menu > System Settings > General > Software Update. Then make sure that Xcode is up to date. Rolling back to the previous version of Xcode might also resolve the issue in some cases.
  2. Reboot your Mac: After trying all the above steps, reboot your Mac and see if the issue persists. A reboot can often reset temporary issues causing this problem

Remember to back up all your important data as mentioned above, so that you can restore it if needed during these troubleshooting steps.

Xcode crash when start
 
 
Q