简体   繁体   English

如何在模拟器上调试MonoTouch应用程序?

[英]How to debug MonoTouch app on simulator?

I'm testing MonoTouch (the idea of developing in C# rather than objective-C sounds great). 我正在测试MonoTouch(用C#而不是Objective-C进行开发的想法听起来很棒)。 I wrote a very simple app, that compiles well, and runs nicely on the simulator. 我编写了一个非常简单的应用程序,可以很好地编译,并且可以在模拟器上很好地运行。

But whenever I add breakpoints and hit Debug, I get: 但是,每当我添加断点并单击“调试”时,我都会得到:

System.Net.Sockets.SocketException: Address already in use
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at Mono.Debugger.Soft.VirtualMachineManager.BeginListen (System.Net.IPEndPoint dbg_ep, System.Net.IPEndPoint con_ep, System.AsyncCallback callback) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Debugger.Soft.RemoteSoftDebuggerSession.StartListening (MonoDevelop.Debugger.Soft.RemoteDebuggerStartInfo dsi) [0x00000] in <filename unknown>:0 
  at MonoDevelop.Debugger.Soft.IPhone.IPhoneDebuggerSession.OnRun (Mono.Debugging.Client.DebuggerStartInfo startInfo) [0x00000] in <filename unknown>:0 
  at Mono.Debugging.Client.DebuggerSession+<Run>c__AnonStorey6.<>m__2 () [0x00000] in <filename unknown>:0 

I've tried reading the documentation and FAQs, changing targets, and almost every other solution I could google (most weren't relevant - it seems this error mostly crops up when you develop ASP.Net Mono projects). 我已经尝试阅读文档和常见问题解答,更改目标以及几乎可以用google搜索的所有其他解决方案(大多数都不相关-似乎在开发ASP.Net Mono项目时大多会出现此错误)。 I'm really hoping there's a simple"turn that switch" solution to this. 我真的希望有一个简单的“转弯”解决方案。

For the record, I'm using: 作为记录,我正在使用:

  1. MonoDevelop 2.4.2 MonoDevelop 2.4.2
  2. MonoFramework-2.10.1_3 MonoFramework-2.10.1_3
  3. MonoTouch 4 Trial (could that be blocking debugging?) MonoTouch 4试用版(这可能会阻止调试吗?)
  4. Mac OX 10.6.7 Mac OX 10.6.7
  5. Libraries added: System.Net, System.Text, System.IO and reference to System.Json 添加了库:System.Net,System.Text,System.IO和对System.Json的引用

As always, thanks for your time, 一如既往,感谢您的宝贵时间,

Guy 盖伊

Sounds like some other process is using the same port that the soft debugger is trying to use. 听起来好像其他进程正在使用软调试器尝试使用的端口。

Try this command in terminal: 在终端中尝试以下命令:

sudo lsof -i -P | grep -i "listen"

It should help you figure out what process is causing the issue. 它应该可以帮助您找出导致问题的原因。 Hopefully it is something you can close/kill or remove from your Mac. 希望您可以关闭/杀死它或从Mac中删除它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM