9

Today I have updated xcode. when i tried to run project on simulator(ios version < 9.0) I got this error.

"Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime.

It ran perfectly on ios9.0 simulator. here is screen shot. please help me.enter image description here enter image description here

sandy
  • 181
  • 2
  • 3
  • 12
Saurabh Prajapati
  • 2,348
  • 1
  • 24
  • 42

4 Answers4

11

This will also occur when you don't have the simulator actually installed within XCode. I recently upgraded to XCode 7.1 and didn't install all simulators and received this same error.

  • Go to Preferences -> Downloads
  • Verify you have a checkmark next to the desired Simulator you are trying to run within XCode.
  • If no checkmark, then install the simulator of choice. 8.1, 8.2, 8.3, 8.4
Nick N
  • 984
  • 9
  • 22
2

I don't think that there is an "officially supported" way to solve this yet, but have a look at this answer (which originates from this more detailed troubleshoot) for a potential fix.

[Edit] In you case, try running those:

sudo cp "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.‌​dylib"{,.bak}

sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/D‌​eveloper/SDKs/iPhoneSimulator.sdk/usr/lib/system/host/liblaunch_sim.dylib" "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.‌​dylib"
Community
  • 1
  • 1
Phil Gref
  • 987
  • 8
  • 19
  • Did the command output any kind of error? What version of Xcode do you have? What emulator version numbers did you try to the command with? – Phil Gref Sep 30 '15 at 04:29
  • Try with 8.1 or 7.1, and be sure to remove the -beta in Xcode-beta.app if you are not using Xcode beta. – Phil Gref Sep 30 '15 at 04:55
  • i m not using beta version of xcode! i have updated xcode. – Saurabh Prajapati Sep 30 '15 at 04:56
  • My point is: don't just copy and paste both commands from the article I linked. Be sure to 1) Change the "Xcode-beta.app" part to "Xcode.app" and 2) Change the iOS version number in both commands to the version of an "older" simulator that you have installed (ex 8.1) – Phil Gref Sep 30 '15 at 07:15
  • Updated my answer with commands that include the changes I mentioned. Just check if there are any errors that pop up when you execute one or the other. – Phil Gref Sep 30 '15 at 16:01
  • Worked for me on Yosemite with Xcode 7.1 and trying to run iOS 7.1 simulator – Tom K Nov 09 '15 at 22:38
1

First, find the target file:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/host/liblaunch_sim.dylib You need make backup liblaunch_sim.dylib

Second, copied to destination (Remember to backup)

/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib And If need it to: iOS 8.1.simruntime iOS 8.2.simruntime iOS 8.3.simruntime All done.

Hope it helps.

ale-ALTO
  • 11
  • 1
0

I faced similar problem this problem occurs when we have multiple versions of Xcode Installed ... So i force quit all the xcode and simulator and then open the xcode version you want to open.

Abhishek
  • 509
  • 3
  • 12