5

The issue is fixed with recent update of Mac OSX.

I am using Xcode 8 on Mac Mini running OSX El Capitan (10.11.6). When I deploy my app on simultor is shows following error messages:

  1. "launchd_sim quit unexpectedly"

  2. "Unable to boot the iOS simulator"

How to resolve such type of issues?

Detailed exception report:

Process:          launchd_sim [16545]

Path:             /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/sbin/launchd_sim

Identifier:       launchd_sim

Version:          4.0.0 (972.1.5)

Code Type:        X86-64 (Native)

Parent Process:   ??? [1]

Responsible:      launchd_sim [16545]

User ID:         501



Date/Time:        2016-10-25 13:53:29.247 +0530

OS Version:       Mac OS X 10.11.6 (15G1004)

Report Version:   11

Anonymous UUID:  6844F1F8-F647-09F6-8FB0-A7B9C14F843B



Time Awake Since Boot: 17000 seconds



System Integrity Protection: enabled



Crashed Thread:   0

Dispatch queue: com.apple.main-thread



Exception Type:   EXC_BAD_INSTRUCTION (SIGILL)

Exception Codes:  0x0000000000000001, 0x0000000000000000

Exception Note:   EXC_CORPSE_NOTIFY



Application Specific Information: could not create temporary state directory

EDIT:

To check disk permissions:

sudo /usr/libexec/repair_packages --verify --standard-pkgs /

Output:

Permissions differ on "tmp", should be drwxrwxrwt , they are lrwxr-xr-x .

To repair disk permissions:

sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /

Output:

Permissions differ on "tmp", should be drwxrwxrwt , they are lrwxr-xr-x .
Unable to set owner & group on "tmp". Error 1: Operation not permitted
Unable to set permissions on "tmp". Error 1: Operation not permitted
6
  • do not know if this is the case, but in my case it was not possible to install xcode 8 without upgrading to macOS Sierra. It is very likely that there are dependencies among them, I find no reason why you did not show the same warning to you
    – jose920405
    Oct 25, 2016 at 13:42
  • I don't have macOS Sierra on my Mac Mini. How that can affect working on Xcode simulators? Oct 26, 2016 at 6:23
  • What is the output of stat /tmp and stat /private/tmp? Oct 26, 2016 at 15:49
  • 1
    @jose920405 There is no dependency on macOS Sierra. The issue here (and likely in your case) is that we can't create a temporary directory in /tmp. That is almost always due to user error (eg: deleting /tmp), but given the recent deluge of people hitting this issue, I suspect that a 3rd part installer or a bad blog post or something might be to blame. I've seen about 10 reports of issues like this on stackoverflow over the past two weeks but not a single report which includes the necessary data to understand how the system got into that state in the first place. Oct 26, 2016 at 16:33
  • Also, what is the output of pkgutil --file-info /tmp and pkgutil --file-info /private/tmp Oct 26, 2016 at 16:44

4 Answers 4

6

This error indicates that launchd_sim is unable to create its temporary state directory (/private/tmp/com.apple.CoreSimulator.SimDevice....launchd_sim).

This can happen if /private/tmp is deleted or has changed permissions.

There have been a high volume of reports of this issue lately. The reason appears to be that the restricted bit is getting set on /private/tmp, which is why some users have reported that disabling SIP acts as a workaround for this issue.

The correct fix is to remove the restricted bit from that path. If you boot your system into recovery mode and launch Terminal, you should be able to do this with:

chflags norestricted /Volumes/.../private/tmp

or a larger hammer:

rm -rf /Volumes/.../private/tmp
mkdir /Volumes/.../private/tmp
chmod 1777 /Volumes/.../private/tmp
chown root:wheel /Volumes/.../private/tmp
8
  • Thank you for the reply. I have been facing the same issue with other applications such as Android Studio also. I have tried this command: "sudo /usr/libexec/repair_packages --verify --standard-pkgs /" to check if there are any permissions issues and I found that the permissions for the "/tmp" folder is changed. Oct 27, 2016 at 6:23
  • 1
    Please provide the requested data in a radar and mention the ticket number here. Thanks. Oct 27, 2016 at 6:35
  • Posted the bug in radar. Token number is: 28976244 Oct 27, 2016 at 6:44
  • What if I boot my mac in recovery mode and try command: 'csrutil disable' followed by command: sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /. Will I be able to fix the permissions change issue>? Oct 27, 2016 at 6:47
  • 1
    Thanks for the radar. I think we've figured out the cause, so no more data is needed. I've been told that repair_packages doesn't work any more, but I see it still exists in ElCap, so maybe that comment was just referring to Sierra. You can certainly give it a try, but it might not work. We're working on rolling out a fix for the issue, so another option is to sit tight for a little bit if that doesn't work. Oct 28, 2016 at 6:27
6

These commands did the trick for me:

sudo chown root:admin /tmp; sudo chmod 1777 /tmp
sudo chown root:wheel /private/tmp; sudo chmod 1777 /private/tmp
1
  • Fixed my Xcode 12.2 (12B45b) issue, should be the accepted answer.
    – Codetard
    Nov 16, 2020 at 8:14
1
$ sudo chmod 1777 /Volumes/Macintosh\ HD/private/tmp

worked for me.

0
-1

The problem is, for some reason, your system has orphaned launch_sim processes.

The solution is to:

  1. quit the simulator
  2. open Activity Montior and search for sim.
  3. manually Force Quit any launch_sim, ScriptAgent, or instruments processes.
5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.