iOS - strange error when testing on simulator

2019-01-01 16:21发布

I was testing my app on the simulator when it crashed on clicking a button of a UIAlertView. I stopped debugging there, made some changes to the code and built the app again. Now when I run the application, I get this error in the console

Couldn't register com.myApp.debug with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.Program received signal: “SIGABRT”.

I tried removing the app from the simulator, doing a clean build but I still get this error when I try to run the app.

What should I do to be able to run the app on my simulator again?

30条回答
君临天下
2楼-- · 2019-01-01 16:58

Restarted the Device, Worked! :D

Thanks Everyone for the great suggestions.

查看更多
情到深处是孤独
3楼-- · 2019-01-01 16:58

This error used to occur in older versions of the iOS Simulator because older instances of a job in another device that was shutting down could collide with the new instance.

iOS 6.0 and later should not experience issues like this because iOS 6.0 introduced the usage of bootstrap subsets, and iOS 7.0 introduced the usage of a dedicated bootstrap server (launchd_sim) which is completely isolated from the host's bootstrap server.

查看更多
像晚风撩人
4楼-- · 2019-01-01 16:59

This error happens a lot to me, almost every time I test the app in the Simulator, forcing me to restart.

Here's a workaround if you want to get some work done:

  • Click your project in the Project navigator
  • Go Target -> Info
  • Add a key for Application does not run in background and set to YES.

This will mean that when you press the home button in the simulator or quit the simulator, the app doesn't hang.

Don't forget to change this setting back before distribution! Put it on your release checklist :)

查看更多
看风景的人
5楼-- · 2019-01-01 17:03

I find I have started having this issue with Lion + Xcode 4.2. I have also experienced the issue in Xcode 4.3.

I have tried all the suggestions but none of them have worked other than a full reboot.

Here is how you determine if you require a reboot quickly.

List out all your Zombie processes:

ps -el | grep 'Z'

If you see your app listed as a Zombie process you will need to reboot your machine. The error message states "This generally means that another instance of this process was already running or is hung in the debugger". Well, Xcode is detecting this Zombie process which you can't kill. The only way you can then fix it is with a system reboot. :(

EDIT, 20120823: I have some better knowledge of Zombie processes so I wanted to update this answer. A Zombie process is created when a parent process does not call wait() (wait for process to change state) on a terminating child process. You can't run 'kill' directly on a Zombie process but if you kill the parent process, the zombie child process will be 'reaped' and removed from the process table.

I haven't seen this issue in a long while so haven't inspected to see what the parent process is in this scenario. The alternative to killing the parent process is to reboot your system. :)

查看更多
像晚风撩人
6楼-- · 2019-01-01 17:03

I had same problem and solved it by doing the following

  • Deleting the app from the device,
  • Disconnecting the device from Mac,
  • Turning the device off and back on,
  • Quitting and relaunching Xcode,
  • Quitting Instruments,
  • Finally, Clean and Build again.

I also did one more thing, because Xcode is configured to use iOS 5.0 and my project uses iOS 4.3

  • Remove all frameworks and add them again.
查看更多
人气声优
7楼-- · 2019-01-01 17:03

Happened a lot for me with Xcode 4.2.1 on Lion. Updated to 4.3.2 and it doesnt happen anymore. Glad they fixed it.

查看更多
登录 后发表回答