Tool: Fix bootstrap server error when launching from xCode to iOS Simulator
Since the release of XCode 4.2 I have noticed a certain error poping up after buidling reguarly. The error incidcates that the iOS Simulator already has a process running or is hung. The anoying part is that even if you quit XCode and iOS Simulator, the problem wont go away.
This is the error:
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”.
OR:
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.
It didn’t happen every day but once a week on my work computer (MacBook Air), but now since two weeks ago this started also on my private computer (MBP) and its really anoying.
So, I googled a bit (didn’t really help that much) and tried some stuff from my own imagination and found out that if I kill all processes with “iPhone” in it, I can build again. It works for me almost every time… so I made this into a little script to run from the terminal and now I am sharing it with you!
The script
Make a .sh file called killiPhone.sh, and put it where ever you want. I put mine into my home directory. Give it chmod +x (to execute it).
Add the following content to the file:
#!/bin/bash
#
# Kills all processes with iPhone in it
# Written by Paul Peelen [http://PaulPeelen.com]
# USE AT OWN RISK!
#
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Get the running processes that have iPhone in it
result=$(ps -A |grep iPhone |awk {'print$1'} | tr "\n" " ");
# Kill them one by one
for x in $result
do
kill -9 "$x"
done
What does it do?
What is does is that it first check if you are running it at super user. Then it check your processlist for any process with “iPhone” in it. Then it kills alls these processes.
Warning!
Like mentioned above, it kills all processes with iPhone in it. You are using this script at own risk, I am not responsible for you using the script.
License
Feel free to do whatever you want with it, at own responsibility and risk. If you publish it on your own website (modified or not), please refer back to this page!
January 3rd, 2012 at 1:03
I´ve tried it with no success, same error (even exiting Xcode and simulator, rebuilding…), nothing seems to do the trick. Thanks anyway
January 3rd, 2012 at 1:06
I have noticed it as well a few times, despite my script. for 9 out of 10 times it works for me though.
Can you see any weird processes when you type
ps -A?January 3rd, 2012 at 13:16
Yep, I found two zombie processes (with no parent) containing the name of my app. I think there is no way to get rid of them except rebooting, since kill command can´t do nothing with zombies. Any idea?.
Thanks for replying!.
January 3rd, 2012 at 13:20
Didn’t work with the
-9either? Have a look at this page otherwise: http://www.cyberciti.biz/tips/killing-zombie-process.htmlJanuary 3rd, 2012 at 14:33
Already tried (even with sudo) and nothing.
It’s the fourth or fifth time that it happens, so annoying… I think it´s related to weird and random Xcode´s crash message.