4
votes

I'm new to MonoTouch and more times than not, when I try to run my MonoTouch app on the iPhone simulator (debug mode and regular), I receive a long error output that begins with the following message:

Error connecting stdout and stderr (127.0.0.1:10001) Couldn't register com.yourcompany.[appnamehere] 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.Stacktrace:

at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00004> at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00004> at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x00089> at MonoTouch.UIKit.UIApplication.Main (string[]) <0x00014> at PodcastManager.Application.Main (string[]) <0x00010> at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) <0x00043>

And ends with:

=================================================================

Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

=================================================================

The weird thing is it will work some of the time. Once, a reboot of my machine did it. Others, just restarting MonoDevelop and/or the simulator.

I can provide the entire error output if you think that may help.

Any ideas?

3

3 Answers

3
votes

This is a problem with the monotouch debugger. Sometimes, when the application crashes, the debugger hangs in memory, and that then prevents you from running the app again. As you said, sometimes closing MonoDevelop and the simulator is enough to clean up the debugger, sometimes you need a full reboot. This is also the experience I have, which is probably the only bad thing I found with monotouch so far.

Many times, I'm able to directly kill the process from the console. To do that, open the console and type "top". You'll see the list of processes using the most memory, your app will likely be on top, using almost 100% of cpu. Save the id of the that line, and type q to quit. Now type "kill -9 ???" where ??? is the id you got from top.

Monotouch 2.0 fixed a lot of these problems, if you haven't updated yet I would seriously recommend you to do so. I'm running the beta channel of 2.0, and its a LOT more stable. Crashes went down from 1 or 2 every hour to 1 or 2 a day. It still happens, though, unfortunately.

1
votes

-- Update -- after updating to 2.0.2 I have not seen this issue.

After playing with it long enough, and coming across this bug report I've come to the conclusion that until it's fixed the way to prevent this error is by NEVER stopping a debug session in the IDE. As long as you stop the debug session when the code is not at a breakpoint by hitting the home button it appears that you will avoid this situation.

0
votes

I think this error comes when any native library of monotouch is missing. It happen due to uninstall Visual Studio or Update Xamarin. I faced the Same error and resolve it by Unistalland reinstall the Xamarin Visual Studio and Xamarin Studio. It takes 10 min and all issues are solved.