English 中文(简体)
MonoTouch debugger never connects to app
原标题:

I have an issue where the MonoDevelop debugger refuses to connect to the simulator. MonoDevelop pops a box saying "Waiting for debugger to connect on 127.0.0.1:10000..." but never connects.

I have uninstalled and reinstalled everything, but still have the same issue.

What am I missing?

Thanks in advance.

问题回答

Try the following:

  1. In the simulator, go to the Settings "app"
  2. Find your app s name in the list below General/Safari/Photos
  3. Tap it to bring up its settings
  4. You should be looking at your app s "Debug Settings"
  5. Is "Enabled" (the first item) set to "On" or "Off"?

That s the first thing to look at. If your app s debug "Enabled" setting is "Off" when you try to debug your app, your app will load in the simulator, and MonoDevelop will say it s trying to connect (because it is), but it won t be able to, so... well, you ll get the results you re describing.

If you go through the steps in that list and encounter any problems (like your app not showing up in the simulator s "Settings" list, or it not having "Debug Settings", or it still not working despite having switched "Enabled" to "On"), then you can try a few other things (in no particular order - just typing what comes to mind):

  • Create a new project from scratch. Does the same thing happen? That is, does this problem exist for all your apps?

  • In MonoDevelop, open your app s project settings, click on "iPhone Build", and, with the configuration set to "Debug" and the platform set to "iPhone Simulator", ensure that "Build debug-mode binaries" is checked.

  • In MonoDevelop, open the "Build" menu, select "Clean All", rebuild your project, and try again.

  • If your app is properly configured, and if its settings on the simulator are correct, then try debugging your app - if MonoDevelop still sits and tries to connect without success, open up a terminal window (while your app is still running) and type "netstat -n -f inet" - do you see "127.0.0.1:10000" anywhere in the list under the "Local Address" column? If not, then something s probably wonky on the simulator.

  • If nothing seems to be working, and if you ve already reinstalled the MonoTouch stack (as it seems you have), you can try opening the iPhone simulator, open the "iPhone Simulator" menu, and click on "Reset Content and Settings..." - it can be an inconvenience, but if you re running out of options, you might as well give it a shot.

Without knowing more about your setup or having access to log files, it s tough to figure out what s going on, but those are a few things I think are worth trying.

Hope this helps - at least to point you in a useful direction :)

I was having the same problem and I ll share my solution in case anyone else made the same embarrassing mistake. I didn t have wifi enabled, so my iPhone didn t have a NAT address like 192.168.1.xxx, so it wasn t able to contact the NAT address that MonoDevelop was listening from.

Enabling wifi and connecting to my home network fixed it.

I have the same problem since few days. The "waiting for debugger to connect" message remains displayed and it is thus impossible to debug the application. In my case, it seems that my Settings file (Settings.bundle) enters in conflict with the debug settings.

In my app s settings, I don t have anymore the debug settings displayed, only my own settings like app version number, ... It is happening both on simulator and device.

The first times I got this issues, my workaround was to add a new project in my solution, set up as startup project and then run it. The debugger was responding! Then, I did a clean build, changed again the startup project and the debugger was working with my app. In the app s settings, the debugger settings was displayed again!

However, I got again this problem today and tried multiple times the workaround with no success....

--- EDIT ----

When deleting the Settings.bundle file, the debugger is working fine

It could also depend from content files (files with Build Action = Content) added inside some particular directories: e.g. you cannot create a directory called Resources and put a content file inside, MonoDevelop hangs saying "Waiting for debugger to connect...." instead of raising a meaningful error.

See also this thread: http://forums.monotouch.net/yaf_postst361_Bug-or-Misunderstanding-Resource-Content--Black-Simulator-Screen.aspx

If you have a custom settings bundle then it will disable the debugger after a clean build. I filed this as a bug: https://bugzilla.xamarin.com/show_bug.cgi?id=3891

As a workaround you can set the build action for your settings bundle s Root.plist to None then do a clean build. Once you ve done that you can then reenable your Root.plist. It will merge your settings with the debug settings. That will work until you do a clean build again, at which point you will have to again disable your Root.plist and rebuild.

I found that if you disable the linker, that often makes these kids of issues go away. Not sure how. alt text

Make sure you ve got in project s oprions --> iPhone Build --> SDK Version set to default. On my machine anythings else causes simulator debugger to hang.

I had to shut down my device and reboot.





相关问题
Write to a File in Monotouch

How would I create and write to a file in a Monotouch iPhone app? The file should persist between application launches, so I guess it has to be placed somewhere in the App bundle ( documents or ...

MonoTouch debugger never connects to app

I have an issue where the MonoDevelop debugger refuses to connect to the simulator. MonoDevelop pops a box saying "Waiting for debugger to connect on 127.0.0.1:10000..." but never connects. I have ...

montouch detect when sound finished playing

In objective C is a method called AudioServicesAddSystemSoundCompletion which allows to add a handler for "audio done notification". So I add the handler call AudioServicesPlaySystemSound and when the ...

Web Services Build Error in Monotouch

My project and web services work fine in the simulator but crash when uploading to an iPhone. It had been working fine before I updated Monotouch from 1.1. Can I revert back to earlier versions of ...

Playing a Sound With Monotouch

No matter what I try (build -> content, NSUrl, filename) I get a null exception : file not found when I try to play a .caf sound file in monotouch. //var path = NSBundle.MainBundle.PathForResource("...

Is MonoDevelop s editor slow for you?

I m using the evaluation version of MonoTouch and MonoDevelop to check out writing iPhone app in C#. However, MonoDevelop s editor is very slow for me. I mean really really slow. I have to type and ...

C# Class Definition

In XCode and objective c, if I want to use a UIGlassButton in interface builder, I put the following line in my header file: @class UIGlassButton; I am now using monotouch c#. Is there a similar ...

热门标签