Bug 14940 - Trouble launching simulator in 1-core VM when using Xcode 5; "Simulator failed to install the application"
Summary: Trouble launching simulator in 1-core VM when using Xcode 5; "Simulator faile...
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 7.0.0.x
Hardware: PC Mac OS
: --- minor
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-09-23 16:41 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-05-24 20:12 UTC (History)
3 users (show)

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

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:

Description Brendan Zagaeski (Xamarin Team, assistant) 2013-09-23 16:41:32 UTC
Reported for forum post:

Possible duplicate of bug #14878.

## Steps to reproduce
1. Set the number of processor cores to 1 (http://www.screencast.com/t/5QOwfnjG), and boot a VMware instance of OS X 10.8.5, with Xcode 5 installed.

2. Create a new iOS project from a template, and launch it in the simulator.

3. Stop the app, and launch it again. Leave the iOS simulator running in the background during this step.

## Result
If the simulator is not yet running, the app launches successfully. Otherwise it fails with the following error:
"ERR: There was an error launching the application: iOS Simulator failed to install the application."


## Additional results
The problem happens for both the iOS 6 and iOS 7 simulators. The problem does not happen if Xcode 4.6 is installed instead of Xcode 5.

The forum user reported that using a VM with 4 cores caused the same problem, but I was unable to reproduce that, at least with the software versions listed below.

## Version information
Xamarin Studio 4.0.12 (build 3)
Xcode 5.0 (3332.25), Build 5A1413
Xamarin.iOS (Starter Edition)
Mac OS X 10.8.5
VMware Fusion 5.0.3 (1040386)
Comment 1 Sebastien Pouliot 2013-09-23 17:35:16 UTC
* the Window title of the simulator says "64 bits", which should not be used (we're 32 bits only right now, no need to make the test cases more complex ;-)

* The "black app" seems identical to what Xcode5 release notes [1] warns about (and our release notes point to this document). That would explain why it works fine with 4.6 too.

If an iOS app is detached, relaunching the same app from Xcode will result in a black screen in the Simulator even though the new app is launched.
Terminate the app in the Simulator or relaunch it for the second time. 14648784

[1] https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/index.html#//apple_ref/doc/uid/TP40001051-SW241

Can you confirm (e.g. Activity Monitor) that the app was launched ?
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2013-09-23 21:10:26 UTC
First I should probably clarify that the simulator gives no trouble when the VM is set to 2 cores or 4 cores, at least on my computer. So this might not be much of a problem in practical use.

* Good point about the 64 bits emulator. I double-checked with the 32 bits emulator, and hit the same error.

* As far as a can tell the app does not launch at all during the second deploy. If I manually delete the app from the simulator, or "Reset Content and Settings", and then re-deploy, the error message still appears. The app is not present on the simulator after these steps.

* I wouldn't be surprised if this is related to one of the Xcode 5 problems. I see the same behavior when running an Xcode-compiled template project via `mtouch --launchsim`. It works if the simulator isn't already running, but produces the "failed to install" error otherwise. That said, starting and stopping the app multiple times via Xcode _does_ work.

/Developer/MonoTouch/usr/bin/mtouch --launchsim=Debug-iphonesimulator/TabbedTestXcode.app

* The "Library/Logs/iOS Simulator/iOS Simulator.log" file includes the following error after each failed deploy attempt:
<Error>: Error communicating with SimulatorBridge: NSInvalidReceivePortException - connection went invalid while waiting for a reply

* I diff'd the iOS Simulator system.log files between a successful re-deploy with 2 cores, and a failed re-deploy with 1 core. The failure case did not include any additional error messages, but the successful case included these additional lines:

0xb0115000 MobileInstallationInstall_Server: Installing app com.yourcompany.tabbedtest
0xb0115000 MobileInstallationInstall_Server: Staging: 0.01s; Waiting: 0.00s; Installation: 0.01s; LS Sync: 0.00s; Overall: 0.02s
0xb0115000 handle_install_for_ls: Install of "/Users/user/Projects/TabbedTest/TabbedTest/bin/iPhoneSimulator/Debug/TabbedTest.app" requested by SimulatorBridge
0xb0115000 install_application: Performing developer delta patch
LaunchServices:(called by PID 345) Identifiers file does not exist.
Need to synchronize with MobileInstallation
Comment 4 Sebastien Pouliot 2016-05-24 20:12:05 UTC
Never heard of this afterward (Xcode 5.x+). If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!