OStack程序员社区-中国程序员成长平台

标题: ios - 删除/private/tmp 后无法启动 iOS 模拟器 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 10:06
标题: ios - 删除/private/tmp 后无法启动 iOS 模拟器

本周我无法启动我的模拟器,我尝试了一些文章中的几种解决方案,但它不起作用。我的 MacOS 版本是 OS X 10.10.5 (14F27),我的模拟器是 iOS 8.4。

我从 ~/Library/Logs/CoreSimulator/CoreSimulator.log 获取日志

Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service com.apple.SystemConfiguration.PPPController: launch_sim_register_endpoint: 0xfffffecc Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service com.apple.audio.audiohald: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service com.apple.coreservices.lsuseractivity.simulatorsupport: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service com.apple.FSEvents: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service com.apple.SystemConfiguration.configd: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service IndigoHIDRegistrationPort: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service PurpleFBTVOutServer: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Could not register service PurpleFBServer: launch_sim_register_endpoint: 0x44e Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=NSPOSIXErrorDomain Code=60 "Unable to boot the iOS Simulator." UserInfo=0x7fbb204683f0 {NSLocalizedDescription=Unable to boot the iOS Simulator., NSLocalizedFailureReason=launchd failed to respond.} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=NSPOSIXErrorDomain Code=60 "Unable to boot the iOS Simulator." UserInfo=0x7fbb204683f0 {NSLocalizedDescription=Unable to boot the iOS Simulator., NSLocalizedFailureReason=launchd failed to respond.} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=com.apple.CoreSimulator.SimError Code=146 "Unable to lookup in current state: Shutdown" UserInfo=0x7fbb20808710 {NSLocalizedDescription=Unable to lookup in current state: Shutdown} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error looking up host support port Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=com.apple.CoreSimulator.SimError Code=146 "Invalid device state" UserInfo=0x7fbb2083b420 {NSLocalizedDescription=Invalid device state} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=com.apple.CoreSimulator.SimError Code=146 "Unable to lookup in current state: Shutdown" UserInfo=0x7fbb2080c350 {NSLocalizedDescription=Unable to lookup in current state: Shutdown} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=com.apple.CoreSimulator.SimError Code=146 "Unable to lookup in current state: Shutdown" UserInfo=0x7fbb2080c350 {NSLocalizedDescription=Unable to lookup in current state: Shutdown} Aug 27 11:29:14 LL-MBP.local com.apple.iphonesimulator[8330] : Error Domain=NSPOSIXErrorDomain Code=60 "Unable to boot the iOS Simulator." UserInfo=0x7fda2a9020f0 {NSLocalizedDescription=Unable to boot the iOS Simulator., NSLocalizedFailureReason=launchd failed to respond.} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=com.apple.CoreSimulator.SimError Code=146 "Unable to lookup in current state: Shutdown" UserInfo=0x7fbb20b0f850 {NSLocalizedDescription=Unable to lookup in current state: Shutdown} Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error looking up host support port Aug 27 11:29:14 LL-MBP.local CoreSimulatorService[8316] : Error Domain=com.apple.CoreSimulator.SimError Code=146 "Invalid device state" UserInfo=0x7fbb20b00e20 {NSLocalizedDescription=Invalid device state}

有人对此有任何想法吗?

我会很感激的!

最后我在@Jeremy Huddleston Sequoia 的帮助下解决了这个问题。一开始,我在网上尝试了很多解决方案,包括删除/private/tmp 文件夹。所以无论我清理多少次重新安装模拟器,它都不起作用。所以要小心这个



Best Answer-推荐答案


这些错误表明 launchd_sim 未加载或未运行,并且看门狗已触发以通知您失败。

如果您在 OS X 10.10.5 中禁用 AMFI,模拟器运行时将无法使用,并且会像这样显示。

但是,在您的情况下,launchd_sim 在启动时崩溃。崩溃日志表明它在尝试在/private/tmp 中创建其状态目录时遇到错误。

这可能发生在您删除/private/tmp (或错误地重新创建它)。要创建/private/tmp,请执行以下操作:

sudo mkdir /private/tmp
sudo chmod 1777 /private/tmp

关于ios - 删除/private/tmp 后无法启动 iOS 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32239906/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4