32

I have installed latest Xcode 7 beta 2 version, when I am trying to run the application in iOS 7.1 Simulator its giving this error message:

The iOS 7.1 simulator runtime is not available.

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

Could you please let me know how to resolve this error?

nschum
  • 15,322
  • 5
  • 58
  • 56
IOS Rocks
  • 2,127
  • 2
  • 21
  • 24

5 Answers5

35

Took a lot of browsing but I finally found a solution that worked for me (tried Gend's answer but didn't work). Execute the following lines:

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

sudo ln -sf "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/host/liblaunch_sim.dylib" "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib"

Source: https://gist.github.com/leecade/83b4e710d7c741152527

Anthony De Smet
  • 2,265
  • 3
  • 17
  • 24
  • 2
    Works in XCode 7 beta 5 for 7.1 simulator. Thanks – Mike Bevz Aug 18 '15 at 13:43
  • In XCode 7 beta 6 I don't see this error, but I can't launch app because it stuck in loading state. – ChikabuZ Sep 03 '15 at 15:38
  • One of my computers has no "/Library/Developer/", the other has an empty "/Library/Developer/CoreSimulator/Profiles/Runtimes/" folder. – Cœur Sep 12 '15 at 07:36
  • I don't have a CoreSimulator folder in /Library/Developer. – kevinl Sep 16 '15 at 23:10
  • 3
    I got this to work under Xcode 7.0 release too, just had to change "Xcode-beta.app" into "Xcode.app". – GOTO 0 Sep 21 '15 at 23:38
  • 4
    The IPC protocol used by the iOS 7.1 and iOS 8+ liblaunch_sim.dylib are not the same. You will run into issues doing this. – Jeremy Huddleston Sequoia Oct 06 '15 at 23:10
  • @mike have u managed to launch an app on ios7 sim in xcode 7? – deej Oct 22 '15 at 14:17
  • @JeremyHuddlestonSequoia do you have an alternative suggestion to this? Where do we find the iOS 8+ liblaunch_sim.dylib? – amergin Oct 23 '15 at 11:07
  • 2
    @deej yes, it worked in Xcode 7 beta 1, afterwards iOS7 simulator disappeared. So for now there is no way to test it but on a device. – Mike Bevz Nov 05 '15 at 10:34
  • Couldn't run 7.1 simulator on XCode 7.1 official with same error. I updated the commands to `sudo mv "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib"{,.bak}` ...then `sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/host/liblaunch_sim.dylib" "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib"`. Runs, but no output log – larromba Nov 16 '15 at 13:40
  • 1
    7.1 simulator appears in xcode 7.1.1 and xcode is able to install apps, but they have to be run manually. debugging not working either – deej Nov 22 '15 at 20:53
  • unable to boot simulator – Krešimir Prcela Jan 08 '16 at 10:24
  • @Prcela try to close all and the run it or even a restart, I had problems at first as well, so I tried many combination and finally it worked. – Blacky Jan 08 '16 at 16:17
  • For Xcode 7.2.1 it ends up with "unable to boot simulator" alert. As before, I can't run iOS 7 simulator, but now alert message is different. – Valeriy Van Feb 17 '16 at 12:52
16

You can't (At least in an Official way).

Taken from Xcode Beta 2 Documentation (Page 7).

Hope it helps.

EDIT SEPT - 2015:

Thanks Cœur for the info, now you can use previous versions of ios simulator.

Karlo A. López
  • 2,548
  • 3
  • 29
  • 56
  • Further to this: I've tried to find any sort of official or semi-official statement on whether this is likely to be the case after beta. I've failed. – Tommy Jun 25 '15 at 17:22
  • 1
    Link is dead. iOS 8.1 to 8.4 Simulators are supported. Spelling mistake at 'Docummentation'. – Cœur Sep 14 '15 at 01:18
  • 1
    Not sure if this would still be relevant but iOS 7 simulator was working fine on the XCode 7.0 (final). After upgrade to 7.1 I get the same exact error msg as OP. – inteist Nov 02 '15 at 02:14
6

First, find the target file:

/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/host/liblaunch_sim.dylib

You need make backup liblaunch_sim.dylib (Just in case). 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.

Koen.
  • 25,449
  • 7
  • 83
  • 78
Gend
  • 133
  • 3
  • 11
  • 1
    I can't find the CoreSimulator folder under /Library/Developer. Why is that? – kevinl Sep 16 '15 at 23:12
  • @kevinl I find CorseSimulator but Profiles doesn't appear, just "Devices". Tell me if you find it ! And I will tell you if I find :) – Vjardel Sep 16 '15 at 23:46
  • @Viny76 I ended up placing the liblaunc_sim.dylib after getting the iOS 7.1 simulator SDK from my old xcode located: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/lib/system/host/liblaunch_sim.dylib now it works – kevinl Sep 17 '15 at 16:13
  • 1
    Now I get "Unable to boot the Simulator." – Adrian Florescu Oct 28 '15 at 08:34
2

When you are using sudo command and terminal says: "Command not found" Then use command like below.

sudo su (enter)

$ sudo mv "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 8.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib"{,.bak}(enter)

$ sudo mv "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib"{,.bak}(enter)

$ sudo ln -sf "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/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"(enter)

$ sudo ln -sf "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system/host/liblaunch_sim.dylib" "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib"(enter) Exit(enter)

Now relaunch Xcode 7 if open earlier.you will be able to run simulators.

Community
  • 1
  • 1
Hasya
  • 9,792
  • 4
  • 31
  • 46
  • when I try the above, for 7.1, I get mv: rename /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib to /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 7.1.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/host/liblaunch_sim.dylib.bak: No such file or directory – Zvi Aug 29 '16 at 17:40
1

In Xcode 7 beta 6 this seems to be possible now.

http://adcdownload.apple.com/Developer_Tools/Xcode_7_beta_6/Xcode_7_beta_6_Release_Notes.pdf

Xcode 7.0 beta now supports downloadable legacy simulators. (20699475)

I haven't found a place to download these yet though. I will update when/if I find them.

concertman
  • 13
  • 5
  • Any update? I'd love to know where to download these! – DiscDev Sep 21 '15 at 22:55
  • The only thing I've found so far is Gend's answer above and pulling them out of the previous Xcode. Per this thread https://forums.developer.apple.com/thread/17108 it looks like there isn't going to be an official way to do this. – concertman Sep 23 '15 at 08:39