简体   繁体   English

Xcode无法在模拟器上运行应用

[英]Xcode won't run app on simulator

Yesterday I uninstalled my App Store install of XCode and installed it manually from the Apple developer site. 昨天,我卸载了我的App Store安装的XCode,并从Apple开发人员站点手动安装了它。

I had 9.4.1 and downloaded 9.3 我有9.4.1并下载了9.3

Ever since I've not been able to run any apps on the simulator. 自从我无法在模拟器上运行任何应用程序以来。

I see the following error in xcode: 我在xcode中看到以下错误:

Xcode错误消息

I see this error in the Xcode logs: 我在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<…>

and I see this error in the simulator logs: 我在模拟器日志中看到此错误:

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

I've tried the usual culprits, removing derived data/cleaning build folder/restarting simulator/restarting xcode/restarting macbook. 我已经尝试过通常的罪魁祸首,删除派生数据/清理构建文件夹/重启模拟器/重启Xcode /重启Macbook。

I've also tried completely uninstalling xcode and reinstalling (uninstalled 9.3 and tried installing 9.4.1), doesn't seem to make any difference. 我也尝试完全卸载xcode并重新安装(卸载9.3并尝试安装9.4.1),似乎没有什么区别。

Seen a few similar questions posted and one of the most common fixes seems to be removing any checked blank environment variables in the scheme, I can't find any to remove. 看到发布了一些类似的问题,并且最常见的修复方法之一似乎是删除方案中所有选中的空白环境变量,但我找不到要删除的任何变量。 I've tried running both in debug and release, I've tried disabling Debug executable and selecting the executable on launch. 我尝试在调试和发行版中都运行,我尝试禁用调试可执行文件并在启动时选择可执行文件。 Also tried deleting the scheme and creating a new one. 还尝试删除该方案并创建一个新方案。

Also set verbose logging on the simulator and I didn't get any more illuminating information. 还要在模拟器上设置冗长的日志记录,而我没有得到更多的照明信息。

If if install the app manually using simctl and launch it using simctl it will launch without complaints (that's what prompted me to try disabling debug executable). 如果使用simctl手动安装该应用程序,然后使用simctl启动该应用程序,则该应用程序将启动而不会发出投诉(这就是促使我尝试禁用调试可执行文件的原因)。

I see this issue regardless of which project/workspace I have open in Xcode, the example I'm using currently is just a blank project I created to try and get to the bottom of the issue. 无论我在Xcode中打开了哪个项目/工作区,我都看到了这个问题,我当前使用的示例只是我创建的一个空白项目,试图解决问题的根源。

I'm edging closer and closer to a complete restore being the most logical next step, but I'd like to avoid that if possible. 我正在逐步接近完成还​​原,这是最合乎逻辑的下一步,但我希望尽可能避免这种情况。

*EDIT - Discovered the issue was with anti virus not liking it when xcode wasn't named Xcode.app. *编辑-发现问题是由于xcode未命名为Xcode.app时反病毒不喜欢它。 Sigh. 叹。

So, it looks like renaming the Xcode.app file now leads to some pretty ropey behaviour. 因此,似乎重命名Xcode.app文件现在会导致一些非常危险的行为。

Up till now when managing multiple installs of xcode I'd just rename the files to something like Xcode.9.4.1.app, not sure when/if that's changed but the only way I can fix the simulator issue is to keep the Xcode.app filename. 到现在为止,当管理多个xcode安装时,我只是将文件重命名为类似Xcode.9.4.1.app的文件,不确定何时/是否已更改,但是我可以解决模拟器问题的唯一方法是保留Xcode。应用程序文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM