launchd_sim 崩溃:无法创建临时状态目录

Nim*_*iya 3 macos xcode ios ios-simulator

该问题已通过 Mac OSX 的最新更新解决。

我在运行 OSX El Capitan (10.11.6) 的 Mac Mini 上使用 Xcode 8。当我在 simultor 上部署我的应用程序时,显示以下错误消息:

  1. “launchd_sim 意外退出”

  2. “无法启动iOS模拟器”

如何解决此类问题?

详细异常报告:

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
Run Code Online (Sandbox Code Playgroud)

编辑:

要检查磁盘权限:

sudo /usr/libexec/repair_packages --verify --standard-pkgs /
Run Code Online (Sandbox Code Playgroud)

输出:

Permissions differ on "tmp", should be drwxrwxrwt , they are lrwxr-xr-x .
Run Code Online (Sandbox Code Playgroud)

修复磁盘权限:

sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
Run Code Online (Sandbox Code Playgroud)

输出:

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
Run Code Online (Sandbox Code Playgroud)

Aug*_*ley 6

这些命令对我有用:

sudo chown root:admin /tmp; sudo chmod 1777 /tmp
sudo chown root:wheel /private/tmp; sudo chmod 1777 /private/tmp
Run Code Online (Sandbox Code Playgroud)


Jer*_*oia 5

此错误表明launchd_sim 无法创建其临时状态目录(/private/tmp/com.apple.CoreSimulator.SimDevice....launchd_sim)。

如果 /private/tmp 被删除或更改了权限,就会发生这种情况。

最近有大量关于这个问题的报道。原因似乎是在 /private/tmp 上设置了受限位,这就是为什么一些用户报告禁用 SIP 作为解决此问题的方法的原因。

正确的解决方法是从该路径中删除受限位。如果您将系统启动到恢复模式并启动终端,您应该可以通过以下方式执行此操作:

chflags norestricted /Volumes/.../private/tmp
Run Code Online (Sandbox Code Playgroud)

或更大的锤子:

rm -rf /Volumes/.../private/tmp
mkdir /Volumes/.../private/tmp
chmod 1777 /Volumes/.../private/tmp
chown root:wheel /Volumes/.../private/tmp
Run Code Online (Sandbox Code Playgroud)


Man*_*nan -1

问题是,由于某种原因,您的系统有孤立的 launch_sim 进程。

解决办法是:

  1. 退出模拟器
  2. 打开 Activity Monitor 并搜索 sim。
  3. 手动强制退出任何 launch_sim、ScriptAgent 或 Instruments 进程。