Xcode 不会 运行 模拟器上的应用程序

Xcode won't run app on simulator

昨天我卸载了我在 App Store 安装的 XCode 并从 Apple 开发者网站手动安装了它。

我有 9.4.1 并下载了 9.3

自从我无法在模拟器上运行任何应用程序。

我在 xcode 中看到以下错误:

我在 Xcode 日志中看到这个错误:

iOSSimulator: 56E6A4AD-4D6F-4CB4-A666-E1DE0D49B101: Failed to launch app with identifier: com.mikevelu.Test and options: {

"activate_suspended" = 0;

arguments =     (

);

environment =     {

    "DYLD_FRAMEWORK_PATH" = "/Users/mikemurray/Library/Developer/Xcode/DerivedData/Test-fqvnwaelkrhrooepamzxmakiidkf/Build/Products/Debug-iphonesimulator";

    "DYLD_INSERT_LIBRARIES" = "/Applications/Xcode9.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode9.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode9.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Develope<…>

我在模拟器日志中看到这个错误:

(UIKitApplication:com.mikevelu.Test[0xf61e][2808][2983]): Service could not initialize: 99Z999: xpcproxy_sim + 9282 [1524][AF02A7E2-099C-3F21-AB91-5AA7DB3FFA58]: 0x5

我尝试了通常的罪魁祸首,删除派生的 data/cleaning 构建 folder/restarting simulator/restarting xcode/restarting macbook。

我也试过完全卸载 xcode 并重新安装(卸载 9.3 并尝试安装 9.4.1),似乎没有任何区别。

看到一些类似的问题,最常见的修复之一似乎是删除方案中所有选中的空白环境变量,但我找不到要删除的任何内容。我已经在调试和发布中尝试 运行ning,我已经尝试禁用调试可执行文件并在启动时选择可执行文件。还尝试删除方案并创建一个新方案。

还在模拟器上设置了详细日志记录,但我没有得到更多有启发性的信息。

如果使用 simctl 手动安装应用程序并使用 simctl 启动它,它将在没有投诉的情况下启动(这就是促使我尝试禁用调试可执行文件的原因)。

无论我在 Xcode 中打开哪个 project/workspace,我都会看到这个问题,我当前使用的示例只是我创建的一个空白项目,试图深入了解问题。

我越来越接近完全恢复是最合乎逻辑的下一步,但我想尽可能避免这种情况。

*编辑 - 发现问题是当 xcode 未命名 Xcode.app 时反病毒软件不喜欢它。叹息

所以,重命名 Xcode.app 文件现在看起来会导致一些相当粗鲁的行为。

到目前为止,在管理 xcode 的多个安装时,我只是将文件重命名为 Xcode.9.4.1.app 之类的名称,不确定 when/if 那是已更改,但我可以解决模拟器问题的唯一方法是保留 Xcode.app 文件名。