113

I just changed some code in my program and got this error:

Couldn't register com.yourcompany.XXX 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 restoring my program to a version that worked, rebooted, restarted, empty caches and rebuild on versions that even worked before.

Any help would be appreciated.

4
  • Having done all of the above. I executed a separate program and that program worked....???
    – MadProfit
    Jul 30, 2010 at 21:23
  • I had this issue shortly after using instruments. I wonder if it's related.
    – Sam
    Nov 9, 2011 at 17:17
  • possible duplicate of iPhone - strange error when testing on simulator
    – chown
    Feb 7, 2012 at 19:18
  • 1
    This problem often comes up for me and it's almost always happening when I mid-install forcefully cancel the install process, before didFinishLaunching... is called in the app. Since a few years I try to never break an install until it has reached that point because it often cause the above problem. Xcode moving from 3 to 4 and the latest iOS versions or new debugger have not made a difference here.
    – Jonny
    May 28, 2012 at 6:48

21 Answers 21

116

I was able to recover from this by unplugging the iPad, powering it down and back up, clearing all XCode caches and targets, and doing a clean build. I'm running XCode 3.5.4 and iOS 4.2.1

UPDATE: Same problem running Xcode 4.3 and iOS5 - just power-cycle the device.

3
  • 2
    Rebooting the device was what worked for me after I tried everything else.
    – noodl_es
    Jul 26, 2011 at 8:55
  • Worked for my iPhone 4 only after rebooting the device. (same as noodl_es). Can we assume that the "bootstrap server" is something residing on the device, and a "simple" way of fixing problems with it is thus to reboot the device?
    – Jonny
    Jul 28, 2011 at 15:44
  • 6
    @Sam - yeah, I think there are spurious processes that aren't cleaned up well. As for MadProfit, I was hoping for the dubious honor of being his first accepted answer :)
    – Rayfleck
    Nov 9, 2011 at 17:22
26

You might wish to kill all Simulator processes, that can cause this error as well.

Here's a one-liner to kill 'em all:

kill -9 `ps ax | grep Simulator | grep -v grep | awk '{print $1}'` 

Or more concise, like @brianegge mentions as a comment:

killall -9 Simulator
6
  • I pasted this line in Terminal verbatim and it won't run
    – barfoon
    Oct 27, 2011 at 2:52
  • 2
    What error @barfoon? What OS? If you don't have Simulator running you will simply get kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]. Oct 27, 2011 at 9:20
  • @barfoon - probably because you don't have any simulator processes. If you evaluate "kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]", you get no result, so "kill -9 {empty}" returns an error: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] Dec 1, 2011 at 16:49
  • A shorter line would be killall -9 Simulator
    – brianegge
    Jan 14, 2012 at 21:45
  • 1
    You can also try Activity Monitor to kill all the process you want to, its all visible there. Just type Activity Monitor in Spotlight.. Hope this help.
    – iphonic
    Jun 18, 2012 at 9:04
15

My solution was to restart the ipad, wait a while and try again.

0
14

If you get the hang when using the simulator, look at this thread: Strange Error When Testing Simulator

You may find this test of interest, as it will tell you ASAP if the only solution is to reboot now or not:

Open Terminal and run this command: ps -Ael | grep Z. If you get two entries, one "(clang)" and the other your app or company name, you're hosed - reboot.

If you are a developer, enter a short bug and tell Apple how absolutely annoying having to reboot is, and mention they can dup this bug to "rdar://10401934" .

0
11

I received the same problem, running an app on an iPhone from Xcode. The message that I was getting was the same as above:

Couldn't register xxx.com.company.appname with the bootstrap server. This generally means that another instance of this process was already running or is hung in the debugger.

I tried many things to fix the problem, in this order, all which failed:

  • force quitting the app on the iPhone
  • force quitting and then deleting the app the iPhone
  • opening and closing the project
  • cleaning the project
  • restarting XCode

Eventually, I rebooted the iPhone and the problem went away, which leads me to think that the source of the problem is a hung process that Xcode cannot or will not kill. If I am able to reproduce exactly what I was doing during my debugging session to get this strange state I'll add another note here.

0
5

I opened a bug report with Apple: https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/19/wo/WBbbbyopNFW8FFUuNSbk0w/10.66

Please let me know if you can't access it.

Summary: XCode debugger is not releasing bootstrap server port

Steps to Reproduce: While debugging an iPhone iOS5 app in the simulator in Xcode 4.2 Build 4D5163b on Lion 10.7.2, a crash can sometimes result in being unable to start the bugger. Instead, Xcode produces this error:

Couldn't register com.MyApp.MyApp 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”.

Expected Results: Should be able to start debugger after a crash.

Actual Results: Cannot start debugger. The only way I've discovered to make the simulator work again is to restart Mac OS.

Regression:

Notes: Lots of people are having this problem: iPhone - strange error when testing on simulator Couldn't register with the bootstrap Server Bootstrap Server Error in Xcode IPHONE https://discussions.apple.com/message/10416765?messageID=10416765

Quitting XCode and the Simulator (& ensuring ps -Al | egrep "Xcode|Simulator" returns nothing) does not help the problem.

Running "launchtl bslist | grep MyApp" reveals that com.MyApp is still registered with the bootstrap server:

$ launchctl bslist | grep MyApp
A  com.MyApp.MyApp.UIKit.migserver
A  com.MyApp.MyApp

I wrote some code to find the port and invalidate it, but this too fails:

NSMachBootstrapServer *bsserver = [NSMachBootstrapServer sharedInstance];
NSMachPort *port = (NSMachPort *)[bsserver portForName:@"com.MyApp.MyApp"];
[port removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:<#(NSString *)#>
NSLog(@"port = %@",port);   
NSLog(@"port.isValid=%d",[port isValid]);
[port invalidate];
NSLog(@"port.isValid=%d",[port isValid]);       
4

I got the same issue with Xcode 4. The solution was to change the scheme. Run set to Debug, Test set to Debug, Profile set to Release, Analyze set to Debug, Archive set to Release

1
  • Interesting workaround. I has this anoying problem on the iPad simulator. I changed device target to real device, closed the iPad simulator, then re-run the app on the simulator, and it worked. Nov 7, 2011 at 10:47
2

Restarting my computer solved my problem. This error happened when I connected my new iPod Touch to my mac and ran my project in simulator at the same time.

2

The easiest way its to change the target name, Remembert to change it back next day after a restart.

1
  • This is indeed the easiest way. No need to restart. Thanks! May 31, 2012 at 22:33
2

To sum it all up.

Sometimes kill -9 (the process id) helps.
Sometimes (as stated) launchctl list | grep UIKitApplication | grep "(your app name/identifier)" | awk '{print $3}' | xargs launchctl remove works.

But if its a "zombie" process, only a restart will solve your problem.

A temporary solution is to just change the identifier (IOS Application Target, Summary Tab) to something else (like "com.mycompany1.myapp" from "com.mycompany.myapp") but remember to change it back after the reboot and before you submit it.

(of course this will create another app on the simulator, but I guess that's the least of your problems....)

Unfortunately, there is no "easy way to greatness"... ;-)

1

Here is how I think I solved this 'strange' error:

Couldn't register com.yourcompany.XXX 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”.

(1) Clean all the caches, targets, headers on both Xcode and the simulator. (2) Restart your iPhone when it is not connected to the computer and make sure no versions of the program that gave you problems are left on your iPhone. (3) Restore any previous version of your program that you know absolutely worked at one point in time. (4) Shut down your computer/laptop. (I needed to do it 4 times.) Makes no sense to me. (5) Restart your machine and try running a different program to see if you still get the error. If you do not get the error on another program. (6) Compile the program that gave you the error:(1) First with an earlier version that worked. And then, the version that gave you the error. Naturally, you may have to re-add code on a step-wise basis to make sure you know what code caused the error.

1
  • 4
    That's not a solution for the problem, it's a way to make it compile again. Solving the problem would be not getting this error, or a way to get rid of it without the need of restarting the computer... Nov 8, 2011 at 15:15
1

This happened to me because another application was eating up the computer's resources. I quit the simulator, quit the application which was hanging my computer and restarted the simulator, and it worked then. The error means that a previously killed process couldn't reach the end of the queue, and is holding up the current one.

1

Lot's of good answers have been provided for fixing the problem.

I have found that I can recreate this bug by creating a breakpoint in my code so that the execution pauses. Then if I press on the Stop Button the bug will now appear when I try to run the code again. Resuming the execution before pressing the Stop Button therefore avoids this issue.

Hope this helps.

0

closing down xcode then starting it, and restarting my iphone solved my problem

0

I didn't find a better solution than mentioned above: restart the iPhone. It seems that there's a daemon that connects to the Xcode debugger not properly killed.

You can avoid this behavior ALWAYS stopping the debugging session through the "Stop" button in Xcode, and waiting for the app to exit automatically on the iPhone. I always have to reboot if I click "Start" without stopping first, or exiting with the iPhone's button, or something like that. Hope it helps

0

I encountered this issue myself just now while evaluating AppCode. I discovered that XCode had somehow attached itself to my application while I was attempting to attach AppCode to my application. I simply stopped the XCode debug session and it worked as expected. I hope this will help somebody.

0

Just rebooting the device should solve the problem. See the analogous question about the simulator: iPhone - strange error when testing on simulator

0

This may be caused by an instance of your app running in the background. This simplified process worked for me without even having to close xCode or shutdown my computer.

  1. Close simulator
  2. Stop the app from running in xCode.
  3. Open activity monitor and search for a process running with your App NAME.
  4. Kill this process in Activity Monitor
  5. Rebuild your project and you should be all set

In theory Pål's command line solution should work as well. The issue definitely seems to be caused by an extra instance of the app running in the background. The app does not always seem to be getting killed properly after each test in simulator or on the device. I first noticed this when jumping between simulator and a device frequently.

As a preventive measure it is good practice to always hit the stop button in xCode after each test.

0
0

Very interesting results when trying to restart my computer. It said, and this is no joke, that 103 users where "sharing" the system. When I restarted, it back down to the usual four (I have Time Machine stuff for all of my computers going through this computer). I stopped the problem by simply setting up an app that monitors that activity, and does not allow additional users to "share" my computer without my permission. What it does is create a window every time someone wants access, and I have to press "Approve" before they can get in. This didn't work properly until I made the changes below.

  • I made sure it would tell me when somebody stopped sharing. Whenever Xcode has this problem, I know long before it returns the errors.

This is now useful for almost everything, but annoying during gaming of any kind.

  • I then wrote a script that fixed the problem by, basically, clearing the Simulator processes that might possible cause problems.

This app will be very useful to developers, so I am "polishing" it up a bit, then it is off to the App Store. When it gets to that point, I will post a link to it here (it will be free).

0

Okay, I've got a workaround for the hardware issue that doesn't involve rebooting the phone. I assume this will also work on the simulator but I haven't tried it.

Force Springboard to relaunch by changing the language. Settings -> General -> International -> Language.

I just changed it to Spanish, waited for Springboard to relaunch, changed it back to English, and was good to go.

2
  • Note that this just happened to me again and my workaround worked. I think it's solid! May 16, 2012 at 22:26
  • I've tried this quite a few times since posting the original workaround and it's been effective for me. More input would definitely be useful! Sep 14, 2012 at 20:00
0

This evening I got the same issue saying

"Couldn't register com.xxx.yyy 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.(lldb)"

and I got solved

1.Just disconnect my Device (for me its iPhone) from Xcode/ Mac machine

2.Reboot the Device (my iPhone)

3.Removed previously installed/corrupted app

4.Again connect device and started exception

It works well

Hope this will help someone there.

Not the answer you're looking for? Browse other questions tagged or ask your own question.