Xcode 4.3.2,在模拟器上运行的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10168922/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 4.3.2, issue with running on simulator
提问by Veeru
I have been having this weird problem with Xcode 4.3.2, of course after the recent update.
我在 Xcode 4.3.2 上遇到了这个奇怪的问题,当然是在最近的更新之后。
After successfully building and running on the simulator several times, xcode seems to not be able to connect to the simulator and can't even stop the project; it's like the simulator does not exist. I have tried:
在模拟器上多次构建并成功运行后,xcode似乎无法连接到模拟器,甚至无法停止项目;就像模拟器不存在一样。我试过了:
- Stopping the project – doesn't work.
- Quitting the simulator – doesn't work, xcode still shows it's running on the simulator even when I quit the simulator.
- Cleaning the project – doesn't work.
- 停止项目 - 不起作用。
- 退出模拟器 - 不起作用,即使我退出模拟器,xcode 仍然显示它正在模拟器上运行。
- 清理项目 - 不起作用。
I have to force quit xcode to get it communicate with the simulator. Nothing else works. It gets quite frustrating to do it every half an hour. This only started with 4.3.2.
我必须强制退出 xcode 才能让它与模拟器通信。没有其他工作。每半小时做一次会让人很沮丧。这仅从 4.3.2 开始。
I always stop before building and running, so it is not an issue of simulator/xcode getting thrashed by me.
我总是在构建和运行之前停下来,所以这不是模拟器/xcode 被我打败的问题。
Any suggestions?
有什么建议?
回答by Veeru
I have found by chance, it is not a solution by any means -
我偶然发现,这无论如何都不是解决方案-
When xcode hangs, saying it is running the app, but nothing is on simulator, opening the simulator from the dock by clicking on the dock icon (not using command+tab) seems to work.
当 xcode 挂起时,说它正在运行应用程序,但模拟器上没有任何内容,通过单击停靠栏图标(不使用命令+选项卡)从停靠栏打开模拟器似乎可以工作。
It is very weird,but it works; atelast till xcode fixes it.
这很奇怪,但它有效;atelast 直到 xcode 修复它。
回答by Deepjyoti Roy
I had the same damn issue on XCode 4.5.1, but I resolved it just now. When the program is running, it gets compiled but doesn't show anything on the simulator. just click on iOS Simulator icon in dock in order to bring it to front. Click iOS Simulatoron top left -> Reset content and settings -> then force quit the iOS Simulator and run the program again. !!
我在 XCode 4.5.1 上遇到了同样该死的问题,但我刚刚解决了它。当程序运行时,它被编译但在模拟器上不显示任何内容。只需单击 Dock 中的 iOS Simulator 图标即可将其置于最前面。单击左上角的iOS 模拟器-> 重置内容和设置 -> 然后强制退出 iOS 模拟器并再次运行程序。!!
回答by CodaFi
Besides a restart, there is one other way I've managed to get around this:
除了重新启动之外,我还设法解决了另一种方法:
Let's say your app hangs, go to the targets selector in the top of the Xcode window and change your sim target to a new SDK (or if you don't have another SDK, change it to a universal app and run on the opposite device simulator).
假设您的应用程序挂起,请转到 Xcode 窗口顶部的目标选择器并将您的 sim 目标更改为新的 SDK(或者如果您没有其他 SDK,请将其更改为通用应用程序并在另一台设备上运行模拟器)。
Then, when your app loads on the new device/OS completely, quit the sim, change your targets back, et voilà!
然后,当您的应用程序完全加载到新设备/操作系统上时,退出 sim,将您的目标更改回来,等等!
回答by Vineesh TP
Uninstall application from Simulator and again run. Then it will works fine :)
从模拟器卸载应用程序并再次运行。然后它会正常工作:)
回答by Gosoftworks Development
This has frustrated me for -years- now but stumbled across what appears to get things going again for me:
这让我感到沮丧 - 多年 - 现在但偶然发现似乎让我重新开始的事情:
Hide the simulator (iOS Simulator -> Hide iOS Simulator) or Cmd-H, then reopen the simulator.
隐藏模拟器(iOS Simulator -> Hide iOS Simulator)或 Cmd-H,然后重新打开模拟器。
The problem seems to happen when something CPU intensive is happening in the background (like a Time Machine backup) on my old 2 core MacBook.
当我的旧 2 核 MacBook 的后台发生 CPU 密集型事件(如 Time Machine 备份)时,问题似乎就会发生。
回答by Topsakal
Xcode 4.6.3 update (June 13, 2013) resolves the following issue:
Xcode 4.6.3 更新(2013 年 6 月 13 日)解决了以下问题:
- Hang when debugging in iOS Simulator on OS X 10.8.4. 13722320
- 在 OS X 10.8.4 上的 iOS 模拟器中调试时挂起。13722320
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/
You can try to update your Xcode to see if that works for you..
您可以尝试更新您的 Xcode 以查看它是否适合您。