Bug 11341 - Xamarin Studio stops running simulator builds once I got it running against an Ipad
Summary: Xamarin Studio stops running simulator builds once I got it running against a...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 4.0.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
URL:
: 11722 ()
Depends on:
Blocks:
 
Reported: 2013-03-21 20:04 UTC by Jake Simpson
Modified: 2013-04-11 15:11 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Another recording showing that resolution of bug 11341 won't fix this one (1.22 MB, video/mp4)
2013-03-27 12:40 UTC, Carlos Guimarães
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jake Simpson 2013-03-21 20:04:08 UTC
So I've been porting a large app from XNA to IOS. I've been working primarily in the simulator and everything has been fine.

Today I dropped in a provision, got the build running against my Ipad and found it crashes. I'm pretty sure it's because of subtle differences between the simulator and the target in terms of how it handles file paths (the functionality is not 100% the same - the simulator is way more forgiving than the target is). However, on going back to try and run in the simulator, I get "Cannot execute" and a path that I cannot see completely, nor can I select it or open it see the completely path.

Now I've tried cleaning, rebuilding, with no luck. I've tried exiting Xamarin Studio and restarting, and the same thing happens.

This is a show stopper bug for me, because I cannot debug on the device using Xamarin Studio (which is another bug entirely).
Comment 1 Jake Simpson 2013-03-21 20:36:51 UTC
More info. It looks very much like the Xamarin Studio is no longer copying the built bundle to the simulator directories.

The bundle builds successfully and I can see it in the Bin Directory for the Xamarin Studio project, but it is NOT being copied to the place where the simulator runs it from (and it used to be).

Is there some setting that was put in place for the building to target that _stops_ this copying from occurring now? Or is it just a bug?
Comment 2 Jeffrey Stedfast 2013-03-21 21:32:19 UTC
There's no setting, so it's not something you did wrong.

Some other people are reporting similar problems and one person reported that his log file in ~/Library/Logs/XamarinStudio-4.0/Ide.log had an exception thrown by Bind() because the port was already in use.

It might be that we are leaking sockets, so I'm going to try and track that down tomorrow.

As to why files aren't being copied into the Simulator path, that could be a separate bug in the Xamarin.iOS tooling.

For you, it might be that it's not anything to do with Bind() and everything to do with the app not being installed into the Simulator by our iOS tools.

I'll have to do some digging to find out for sure. In the meantime, can you check if your log files contain the Bind() exception?
Comment 3 Jeffrey Stedfast 2013-03-22 15:29:45 UTC
In ~/Library/Preferences/XamarinStudio-4.0/MonoDevelopProperties.xml, look for the MonoTouch settings:

<Property key="MonoTouch.Debugger.UsbDebugging" value="True" />
<Property key="MonoTouch.Debugger.Port" value="10000" />
<Property key="MonoTouch.Debugger.UsePermanentConnection" value="True" />

If you change the MonoTouch.Debugger.Port value to 0, does that fix this?

If so, then I think it's safe to say that a commit I just landed in git master will solve this issue.

The debugger port value is really only necessary for the original way we used to do debugging (we'd have to write that port # into a configuration file in the .app so that the app could connect back to Xamarin Studio, but we have since changed the way we do things so that we can pass that info along via the command-line instead).

What we should have been doing was using a value of 0 when connecting using the newer method (which is actually about a year or so old at this point) but it looks like where there was a merge conflict in the source a few months ago, it reintroduced the use of the MonoTouch.Debugger.Port value.
Comment 4 Jeffrey Stedfast 2013-03-25 16:51:43 UTC
Changing the port to 0 seems to fix it for other users with this problem on the forums
Comment 5 Jeffrey Stedfast 2013-03-27 11:44:57 UTC
*** Bug 11444 has been marked as a duplicate of this bug. ***
Comment 6 Carlos Guimarães 2013-03-27 12:40:58 UTC
Created attachment 3704 [details]
Another recording showing that resolution of bug 11341 won't fix this one
Comment 7 Jeffrey Stedfast 2013-04-11 12:19:11 UTC
Carlos: you probably got bitten by Xamarin Studio restoring the old value (which people on the forums have had happen to them)
Comment 8 Jeffrey Stedfast 2013-04-11 12:19:55 UTC
*** Bug 11722 has been marked as a duplicate of this bug. ***
Comment 9 Jeffrey Stedfast 2013-04-11 15:11:39 UTC
Oh, actually... 

Carlos:

It looks like setting the DebuggerPort to 0 in the config file fixes the simulator, but breaks the device.


Anyways, that's not an issue with my actual fix since my actual fix hard-codes port 0 for the simulator but uses the value in the config file for USB debugging.