Bug 41655 - Can't launch on device
Summary: Can't launch on device
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.8 (tvOS / C7)
Hardware: PC Mac OS
: --- normal
Target Milestone: C7SR1
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
: 41736 ()
Depends on:
Blocks:
 
Reported: 2016-06-09 12:47 UTC by Jayden Spring
Modified: 2016-08-18 21:27 UTC (History)
22 users (show)

Tags:
Is this bug a regression?: Yes
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:
Status:
VERIFIED FIXED

Description Jayden Spring 2016-06-09 12:47:15 UTC
Hi,

Upgraded to XS 6x and xamarin ios 9.8.0.323 however can now not deploy to device - this is happening to my colleague too but does NOT happen on XS 5 with older X.iOS and I am able to deploy to device from XCode on the same machine XS is failing to.

Error when deploying is:
Please ensure your device is connected...

Unhandled Exception:
MonoTouch.MobileDevice.MobileDeviceException: Failed to communicate with the device. Please ensure the cable is properly connected, and try rebooting the device (error: 0xe8000065 kAMDMuxConnectError)
  at MonoTouch.Installation.Device.Connect () <0x10e9fa520 + 0x000a3> in <filename unknown>:0 
  at MonoTouch.Installation.Installer+<ExecuteWithSession>c__AnonStorey0.<>m__0 (System.Object sender, System.EventArgs ea) <0x10e9fa2c0 + 0x0005c> in <filename unknown>:0 
  at MonoTouch.Installation.Device.NotificationCallback (MonoTouch.MobileDevice.am_device_notification_callback_info& info) <0x10e9fa140 + 0x000c5> in <filename unknown>:0 
  at (wrapper native-to-managed) MonoTouch.Installation.Device:NotificationCallback (MonoTouch.MobileDevice.am_device_notification_callback_info&)
[ERROR] FATAL UNHANDLED EXCEPTION: MonoTouch.MobileDevice.MobileDeviceException: Failed to communicate with the device. Please ensure the cable is properly connected, and try rebooting the device (error: 0xe8000065 kAMDMuxConnectError)
  at MonoTouch.Installation.Device.Connect () <0x10e9fa520 + 0x000a3> in <filename unknown>:0 
  at MonoTouch.Installation.Installer+<ExecuteWithSession>c__AnonStorey0.<>m__0 (System.Object sender, System.EventArgs ea) <0x10e9fa2c0 + 0x0005c> in <filename unknown>:0 
  at MonoTouch.Installation.Device.NotificationCallback (MonoTouch.MobileDevice.am_device_notification_callback_info& info) <0x10e9fa140 + 0x000c5> in <filename unknown>:0 
  at (wrapper native-to-managed) MonoTouch.Installation.Device:NotificationCallback (MonoTouch.MobileDevice.am_device_notification_callback_info&)



XS Information:
=== Xamarin Studio Indie ===

Version 6.0 (build 5174)
Installation UUID: 0eeecbe7-3390-4572-8505-59100d825f7e
Runtime:
	Mono 4.4.0 (mono-4.4.0-branch-c7-baseline/5995f74) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 404000182

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.3.1 (10188.1)
Build 7D1014

=== Xamarin.iOS ===

Version: 9.8.0.323 (Xamarin Indie)
Hash: 39ebb77
Branch: cycle7
Build date: 2016-06-01 21:23:15-0400

=== Xamarin.Android ===

Version: 6.1.0.71 (Xamarin Indie)
Android SDK: /Users/Jayden 1/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.8.0.323 (Xamarin Indie)

=== Build Information ===

Release ID: 600005174
Git revision: 694a75f040b7f2309bc43d4f78a3a6572ca898bf
Build date: 2016-06-01 17:28:08-04
Xamarin addins: 33f406fa2dcf214012c78cb846585f062b2e1d24
Build lane: monodevelop-lion-cycle7-baseline

=== Operating System ===

Mac OS X 10.11.4
Darwin Jaydens-iMac.local 15.4.0 Darwin Kernel Version 15.4.0
    Fri Feb 26 22:08:05 PST 2016
    root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Comment 1 Jayden Spring 2016-06-09 12:50:29 UTC
I have just been able to upload it to the device and then started debugging. Debugger seemed to then crash with the following:

Please ensure your device is connected...
Connected to: Jayden's iPhone
warning MT1003: Could not kill the application '/Users/Jayden 1/Dropbox/Shared Folders/Xamarin/TrackerUI/IntelliDrive.iOS/bin/iPhone/Debug/build-iphone7.1-9.3.2/TrackerUI.app'. You may have to kill the application manually.
warning HE0041: Error while processing device notifications: NotificationCallback with unknown message: 5
2016-06-09 13:43:35.997 mtouch[52202:6487448] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-10131/DTDeviceKitBase/DTDKRemoteDeviceConnection.mm:890
Details:  Failed to start Instruments daemon on device “b147907982b1f358fd09cbf71de6185eb6aa68ee”: Error Domain=com.apple.dtdevicekit Code=-402653083 "Could not connect to the device." UserInfo={NSLocalizedFailureReason=Could not connect to the device., com.apple.dtdevicekit.stacktrace=(
	0   DTDeviceKitBase                     0x00000001097ddd72 DTDKCreateNSError + 113
	1   DTDeviceKitBase                     0x00000001097de473 DTDK_AMDErrorToNSError + 741
	2   DTDeviceKitBase                     0x00000001097ee67d __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 302
	3   DTDeviceKitBase                     0x00000001097edd17 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
	4   DTDeviceKitBase                     0x00000001097e0aa4 __DTDKExecuteInSession_block_invoke + 38
	5   DTDeviceKitBase                     0x00000001097e00d2 __DTDKExecuteWithConnection_block_invoke_2 + 477
	6   DTDeviceKitBase                     0x00000001097dfece __DTDKExecuteWithConnection_block_invoke + 107
	7   libdispatch.dylib                   0x00007fff8ae1940b _dispatch_client_callout + 8
	8   libdispatch.dylib                   0x00007fff8ae1a9f2 _dispatch_barrier_sync_f_invoke + 74
	9   DVTFoundation                       0x0000000108f89e76 DVTDispatchBarrierSync + 62
	10  DVTFoundation                       0x0000000108f6a3de -[DVTDispatchLock performLockedBlock:] + 116
	11  DTDeviceKitBase                     0x00000001097dfdd8 DTDKExecuteWithConnection + 223
	12  DTDeviceKitBase                     0x00000001097e0a2e DTDKExecuteInSession + 121
	13  DTDeviceKitBase                     0x00000001097edc50 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 117
	14  DVTFoundation                       0x0000000108f89667 __DVTDispatchAsync_block_invoke + 293
	15  libdispatch.dylib                   0x00007fff8ae2493d _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00007fff8ae1940b _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00007fff8ae1d29b _dispatch_root_queue_drain + 1890
	18  libdispatch.dylib                   0x00007fff8ae1cb00 _dispatch_worker_thread3 + 91
	19  libsystem_pthread.dylib             0x00007fff8eb564de _pthread_wqthread + 1129
	20  libsystem_pthread.dylib             0x00007fff8eb54341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Could not connect to the device., NSLocalizedDescription=Could not connect to the device.}
Object:   <DTDKRemoteDeviceConnection: 0x7f969eea0900>
Method:   -instrumentsConnection
Thread:   <NSThread: 0x7f9699e063a0>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
error HE0007: Could not start Instruments server on the device 'Jayden's iPhone'. Please try rebooting the device.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2016-06-09 12:52:29 UTC
If the app launches then the error from comment #1 is a red herring.

For any crashes please get the device log (using Xamarin Studio's View->Pads->iOS Device Log) and any crash reports from Xcode's Device view.

Have you tried rebooting the device to see if that changes anything?
Comment 3 Jayden Spring 2016-06-09 13:12:09 UTC
Hi Rolf,

Yes rebooted several times now still wont attach the debuger but will deploy.  There are no crashes from the app as I have just figured out since it uploads the application to the device, if I then manually launch the application after the MTouch error has been outputting the debugger will actually connect to the application as it launches.

Here is the output from the iOS Device Log:
Jun 9 14:03:57 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIClientConnection _doBackgroundInstallationForPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/TrackerUI.app_sparse.ipa" type Developer (LSInstallType = (null)) requested by streaming_zip_conduit (pid 229)
Jun 9 14:03:57 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundlePatch ID=co.intellidrive.tracker; Version=9, ShortVersion=1.2.8>
Jun 9 14:03:57 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIInstallableBundlePatch applyPatchWithError:]: Attempting patch update of co.intellidrive.tracker from 9 (1.2.8) to 9 (1.2.8)
Jun 9 14:03:57 iPhone-6 pkd[163] <Warning>: purging cache for 151 > 150
Jun 9 14:03:57 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIInstallableBundle performPreflightWithError:]: Setting skip watch app install flag
Jun 9 14:03:58 iPhone-6 profiled[157] <Notice>: (Note ) MC: Provisioning profiles changed
Jun 9 14:03:58 iPhone-6 profiled[157] <Notice>: (Note ) MC: Updating MIS trust...
Jun 9 14:03:58 iPhone-6 pkd[163] <Warning>: purging cache for 151 > 150
Jun 9 14:03:58 iPhone-6 securityd[105] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jun 9 14:03:58 iPhone-6 securityd[105] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jun 9 14:03:58 iPhone-6 installd[53] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jun 9 14:03:58 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIInstallableBundle _refreshUUIDForContainer:withError:]: Data container for co.intellidrive.tracker is now at /private/var/mobile/Containers/Data/Application/5F3977AB-B8D3-40EF-9565-43F0AB453F35
Jun 9 14:03:58 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIContainer makeContainerLiveReplacingContainer:reason:withError:]: Made container live for co.intellidrive.tracker at /private/var/containers/Bundle/Application/964C1824-00AE-4739-9531-DE6C0731B25D
Jun 9 14:03:58 iPhone-6 installd[53] <Notice>: 0x16e1bb000 -[MIInstaller performInstallationWithError:]: Install Successful; Staging: 0.00s; Waiting: 0.00s; Preflight/Patch: 0.36s, Verifying: 0.26s; Overall: 0.89s
Jun 9 14:03:58 iPhone-6 pkd[163] <Warning>: releasing plug-in hold EB9687D6-84EE-4002-ACEC-8D37895ABF6C at client's request
Jun 9 14:03:58 iPhone-6 online-auth-agent[241] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jun 9 14:03:58 iPhone-6 pkd[163] <Warning>: purging cache for 151 > 150
Jun 9 14:03:59 iPhone-6 SpringBoard[63] <Warning>: Installed apps did change.
Added: {(
)}
Removed: {(
)}
Modified: {(
    "co.intellidrive.tracker"
)}
Jun 9 14:04:00 iPhone-6 mobile_installation_proxy[228] <Error>: 0x16e087000 handle_connection: Could not receive request from host.
Jun 9 14:04:00 iPhone-6 nanoappregistryd[226] <Notice>: (Note ) NanoAppRegistry: Received XPC event <OS_xpc_dictionary: <dictionary: 0x14f668a30> { count = 3, contents =
"_State" => <uint64: 0x14f668270>: 0
"XPCEventName" => <string: 0x14f6687f0> { length = 19, contents = "ApplicationsChanged" }
"Notification" => <string: 0x14f668830> { length = 44, contents = "com.apple.LaunchServices.ApplicationsChanged" }
}>
Jun 9 14:04:04 iPhone-6 syncdefaultsd[301] <Notice>: (Note ) marked "com.me.keyvalueservice" topic as "enabled" on <APSConnection: 0x145d06c60>
Comment 4 Rolf Bjarne Kvinge [MSFT] 2016-06-10 09:12:16 UTC
@Jayden, ok, so if I understand correctly the initial problem where you couldn't deploy to the phone was solved by rebooting the phone, but now Xamarin Studio is not able to launch on device no matter what you do (but the app installs just fine)?
Comment 5 Jayden Spring 2016-06-10 09:49:01 UTC
@Rolf no - after about 5 attempts it deployed but still would not launch or attach debugger. Then I rebooted my phone to try again - still no luck. Only after this when reading log's I  tried manually launching it and letting the debugger attach which is still what both my colleague and I are having to do on two separate machines.
Comment 6 Anders 2016-06-10 13:29:56 UTC
I am also experiencing this issue. I have yet to find a workaround for this, anyone got a temporary solution?
Comment 7 Thomas van der Heijden 2016-06-13 05:37:52 UTC
Same problem.  It installs the app but can't run it with the same error.  The app does NOT launch. 

Please ensure your device is connected...
Connected to: XX iPhone 6
warning MT1003: Could not kill the application '/Users/XX/Projects/XX/src/XX/bin/iPhone/Debug/build-iphone7.2-9.3.2/XX.app'. You may have to kill the application manually.
2016-06-13 15:16:25.824 mtouch[20867:2402610] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-10131/DTDeviceKitBase/DTDKRemoteDeviceConnection.mm:890
Details:  Failed to start Instruments daemon on device “6aa7fe683f16fc880c4571973d5a66a1690d43a7”: Error Domain=com.apple.dtdevicekit Code=-402653083 "Could not connect to the device." UserInfo={NSLocalizedFailureReason=Could not connect to the device., com.apple.dtdevicekit.stacktrace=(
	0   DTDeviceKitBase                     0x000000010e0cfd72 DTDKCreateNSError + 113
	1   DTDeviceKitBase                     0x000000010e0d0473 DTDK_AMDErrorToNSError + 741
	2   DTDeviceKitBase                     0x000000010e0e067d __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 302
	3   DTDeviceKitBase                     0x000000010e0dfd17 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
	4   DTDeviceKitBase                     0x000000010e0d2aa4 __DTDKExecuteInSession_block_invoke + 38
	5   DTDeviceKitBase                     0x000000010e0d20d2 __DTDKExecuteWithConnection_block_invoke_2 + 477
	6   DTDeviceKitBase                     0x000000010e0d1ece __DTDKExecuteWithConnection_block_invoke + 107
	7   libdispatch.dylib                   0x00007fff9006a40b _dispatch_client_callout + 8
	8   libdispatch.dylib                   0x00007fff9006b9f2 _dispatch_barrier_sync_f_invoke + 74
	9   DVTFoundation                       0x000000010d799e76 DVTDispatchBarrierSync + 62
	10  DVTFoundation                       0x000000010d77a3de -[DVTDispatchLock performLockedBlock:] + 116
	11  DTDeviceKitBase                     0x000000010e0d1dd8 DTDKExecuteWithConnection + 223
	12  DTDeviceKitBase                     0x000000010e0d2a2e DTDKExecuteInSession + 121
	13  DTDeviceKitBase                     0x000000010e0dfc50 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 117
	14  DVTFoundation                       0x000000010d799667 __DVTDispatchAsync_block_invoke + 293
	15  libdispatch.dylib                   0x00007fff9007593d _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00007fff9006a40b _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00007fff9006e29b _dispatch_root_queue_drain + 1890
	18  libdispatch.dylib                   0x00007fff9006db00 _dispatch_worker_thread3 + 91
	19  libsystem_pthread.dylib             0x00007fff8de634de _pthread_wqthread + 1129
	20  libsystem_pthread.dylib             0x00007fff8de61341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Could not connect to the device., NSLocalizedDescription=Could not connect to the device.}
Object:   <DTDKRemoteDeviceConnection: 0x7f858eecbf30>
Method:   -instrumentsConnection
Thread:   <NSThread: 0x7f8589c0b880>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
error HE0007: Could not start Instruments server on the device 'XX iPhone 6'. Please try rebooting the device.
Comment 8 Manuel de la Peña [MSFT] 2016-06-14 14:52:41 UTC
*** Bug 41736 has been marked as a duplicate of this bug. ***
Comment 9 Rolf Bjarne Kvinge [MSFT] 2016-06-14 15:02:53 UTC
Could you post the exact iOS version of the device(s) this is happening on? Have you installed the latest iOS 9.3.3 beta?
Comment 10 Jayden Spring 2016-06-14 15:46:25 UTC
All my devices are on 9.3.2.

I restored my iMac to a previous backup and re-upgraded to XS6. At the moment this error has not re-produced on my machine however my colleague who hasn't restored is still experiencing these errors.
Comment 11 Luis Aguilera 2016-06-20 14:09:02 UTC
moving to c7sr1 as work continues to investigate this issue
Comment 13 Rolf Bjarne Kvinge [MSFT] 2016-06-22 08:33:02 UTC
I have not been able to reproduce it, but I think I've been able to implement a workaround.

Can those affected try the following:

* Backup/copy /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch somewhere
* Download https://files.xamarin.com/~rolf/mtouch and put it in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin (overwriting the existing mtouch file there).
* Try to launch again.

The launch output should be the same, except that now it should fallback to an alternative launching implementation if something goes wrong.

Please attach any logs if it still doesn't work.
Comment 14 Songtive Team 2016-06-22 14:46:42 UTC
I've just encountered with the same problem after update from Stable. Tried to replace mtouch without luck:

2016-06-22 17:39:04.147 mtouch[79840:10256149] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-10131/DTDeviceKitBase/DTDKRemoteDeviceConnection.mm:890
Details:  Failed to start Instruments daemon on device “e46fca3fb0c244f4f7fd2455ac8d3781cc258f2d”: Error Domain=com.apple.dtdevicekit Code=-402653150 "The service is invalid." UserInfo={NSLocalizedFailureReason=Please check your setup and try again. (0xE8000022)., com.apple.dtdevicekit.stacktrace=(
	0   DTDeviceKitBase                     0x000000011020ed72 DTDKCreateNSError + 113
	1   DTDeviceKitBase                     0x000000011020f473 DTDK_AMDErrorToNSError + 741
	2   DTDeviceKitBase                     0x000000011021f67d __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 302
	3   DTDeviceKitBase                     0x000000011021ed17 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
	4   DTDeviceKitBase                     0x0000000110211aa4 __DTDKExecuteInSession_block_invoke + 38
	5   DTDeviceKitBase                     0x00000001102110d2 __DTDKExecuteWithConnection_block_invoke_2 + 477
	6   DTDeviceKitBase                     0x0000000110210ece __DTDKExecuteWithConnection_block_invoke + 107
	7   libdispatch.dylib                   0x00007fff9a65e40b _dispatch_client_callout + 8
	8   libdispatch.dylib                   0x00007fff9a65f9f2 _dispatch_barrier_sync_f_invoke + 74
	9   DVTFoundation                       0x000000010f8cbe76 DVTDispatchBarrierSync + 62
	10  DVTFoundation                       0x000000010f8ac3de -[DVTDispatchLock performLockedBlock:] + 116
	11  DTDeviceKitBase                     0x0000000110210dd8 DTDKExecuteWithConnection + 223
	12  DTDeviceKitBase                     0x0000000110211a2e DTDKExecuteInSession + 121
	13  DTDeviceKitBase                     0x000000011021ec50 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 117
	14  DVTFoundation                       0x000000010f8cb667 __DVTDispatchAsync_block_invoke + 293
	15  libdispatch.dylib                   0x00007fff9a66993d _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00007fff9a65e40b _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00007fff9a66229b _dispatch_root_queue_drain + 1890
	18  libdispatch.dylib                   0x00007fff9a661b00 _dispatch_worker_thread3 + 91
	19  libsystem_pthread.dylib             0x00007fff977a54de _pthread_wqthread + 1129
	20  libsystem_pthread.dylib             0x00007fff977a3341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Please check your setup and try again. (0xE8000022)., NSLocalizedDescription=The service is invalid.}
Object:   <DTDKRemoteDeviceConnection: 0x7ff4f5479ce0>
Method:   -instrumentsConnection
Comment 15 Timothy Lee Russell 2016-06-23 05:41:11 UTC
@Rolf -- To me, it looks like the mtouch file in Current/bin is a text file with the following command.

/Library/Frameworks/Mono.framework/Commands/mono --debug /Library/Frameworks/Xamarin.iOS.framework/Versions/9.9.0.288/lib/mtouch/mtouch.exe "$@"

The file is 156 bytes.

The file in your download appears to be a 10+ meg. binary.

Thanks,
Timothy
Comment 16 Rolf Bjarne Kvinge [MSFT] 2016-06-23 08:15:36 UTC
@Timothy, the file from comment 13 only works with Xamarin.iOS 9.8 (current stable), not Xamarin.iOS 9.9 (or newer) where internal implementation changed significantly.

@Songtive, can you post the complete output?
Comment 17 Timothy Lee Russell 2016-06-24 03:44:53 UTC
@Rolf, Ok, that makes sense. If it's any clue, 9.9.0.288 appears to have the same bug so maybe the fix here will inform the solution with the Alpha as well.

Thanks,
Timothy
Comment 18 Eugenio De Hoyos 2016-06-25 06:23:35 UTC
I experienced this same issue with Xamarin.iOS 9.8.1.4 after upgrading.  Oddly, the issue only happens with my iPhone 5 and not with my iPad mini.

In any case, the workaround from Comment 13 worked for me.

Thanks for that, @Rolf!
Comment 19 Rolf Bjarne Kvinge [MSFT] 2016-06-27 10:56:35 UTC
@Eugenio, thanks for confirming this, I'll get the fix into both a service release for the current stable and the alpha channel.
Comment 20 Rolf Bjarne Kvinge [MSFT] 2016-06-28 15:24:19 UTC
Fixed.

The next service release will have this fix.
Comment 21 John Nolan 2016-06-29 11:26:06 UTC Comment hidden (obsolete)
Comment 22 Rolf Bjarne Kvinge [MSFT] 2016-06-29 11:28:21 UTC Comment hidden (obsolete)
Comment 23 John Nolan 2016-06-29 11:31:00 UTC Comment hidden (obsolete)
Comment 24 John Nolan 2016-06-29 11:32:39 UTC Comment hidden (obsolete)
Comment 25 Rolf Bjarne Kvinge [MSFT] 2016-06-29 11:34:19 UTC Comment hidden (obsolete)
Comment 26 John Nolan 2016-06-29 11:47:02 UTC Comment hidden (obsolete)
Comment 27 Rolf Bjarne Kvinge [MSFT] 2016-06-29 11:51:10 UTC Comment hidden (obsolete)
Comment 28 John Nolan 2016-06-29 12:20:53 UTC Comment hidden (obsolete)
Comment 29 Songtive Team 2016-06-29 12:26:45 UTC
@Rolf,

Please find attached full output:
warning MT1003: Could not kill the application '/Users/dev/Documents/Projects/PrototypeMono/Prototype.MonoTouch/bin/iPhone/Debug/build-iphone5.1-10.0/PrototypeMonoTouch.app'. You may have to kill the application manually.
warning HE0030: Could not mount developer tools on 'dev's iPhone': Could not find Developer Disk Image
warning HE0031: Failed to mount developer tools on 'dev's iPhone'.
2016-06-29 15:17:13.885 mtouch[28527:17405470] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-10131/DTDeviceKitBase/DTDKRemoteDeviceConnection.mm:890
Details:  Failed to start Instruments daemon on device “e46fca3fb0c244f4f7fd2455ac8d3781cc258f2d”: Error Domain=com.apple.dtdevicekit Code=-402653150 "The service is invalid." UserInfo={NSLocalizedFailureReason=Please check your setup and try again. (0xE8000022)., com.apple.dtdevicekit.stacktrace=(
	0   DTDeviceKitBase                     0x0000000116878d72 DTDKCreateNSError + 113
	1   DTDeviceKitBase                     0x0000000116879473 DTDK_AMDErrorToNSError + 741
	2   DTDeviceKitBase                     0x000000011688967d __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 302
	3   DTDeviceKitBase                     0x0000000116888d17 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
	4   DTDeviceKitBase                     0x000000011687baa4 __DTDKExecuteInSession_block_invoke + 38
	5   DTDeviceKitBase                     0x000000011687b0d2 __DTDKExecuteWithConnection_block_invoke_2 + 477
	6   DTDeviceKitBase                     0x000000011687aece __DTDKExecuteWithConnection_block_invoke + 107
	7   libdispatch.dylib                   0x00007fff9a65e40b _dispatch_client_callout + 8
	8   libdispatch.dylib                   0x00007fff9a65f9f2 _dispatch_barrier_sync_f_invoke + 74
	9   DVTFoundation                       0x0000000115f35e76 DVTDispatchBarrierSync + 62
	10  DVTFoundation                       0x0000000115f163de -[DVTDispatchLock performLockedBlock:] + 116
	11  DTDeviceKitBase                     0x000000011687add8 DTDKExecuteWithConnection + 223
	12  DTDeviceKitBase                     0x000000011687ba2e DTDKExecuteInSession + 121
	13  DTDeviceKitBase                     0x0000000116888c50 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 117
	14  DVTFoundation                       0x0000000115f35667 __DVTDispatchAsync_block_invoke + 293
	15  libdispatch.dylib                   0x00007fff9a66993d _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00007fff9a65e40b _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00007fff9a66229b _dispatch_root_queue_drain + 1890
	18  libdispatch.dylib                   0x00007fff9a661b00 _dispatch_worker_thread3 + 91
	19  libsystem_pthread.dylib             0x00007fff977a54de _pthread_wqthread + 1129
	20  libsystem_pthread.dylib             0x00007fff977a3341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Please check your setup and try again. (0xE8000022)., NSLocalizedDescription=The service is invalid.}
Object:   <DTDKRemoteDeviceConnection: 0x7fc765530440>
Method:   -instrumentsConnection
Thread:   <NSThread: 0x7fc76050b730>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
error HE0007: Could not start Instruments server on the device 'dev's iPhone'. Please try rebooting the device.
Comment 30 Rolf Bjarne Kvinge [MSFT] 2016-06-29 12:28:40 UTC
@Songtive, that looks like you didn't install the mlaunch binary in the correct location (after the HE0007 error it should try another launch method).
Comment 31 Songtive Team 2016-06-29 12:40:40 UTC
Sorry, I was experimenting with different setups and forgot to returned it back. Here you are the output with "mtouch" provided by you:

Connected to: dev’s iPhone
warning MT1003: Could not kill the application '/Users/dev/Documents/Projects/PrototypeMono/Prototype.MonoTouch/bin/iPhone/Debug/build-iphone5.1-10.0/PrototypeMonoTouch.app'. You may have to kill the application manually.
warning HE0030: Could not mount developer tools on 'dev’s iPhone': Could not find Developer Disk Image
warning HE0031: Failed to mount developer tools on 'dev’s iPhone'.
2016-06-29 15:31:25.439 mtouch[29274:17431656] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-10131/DTDeviceKitBase/DTDKRemoteDeviceConnection.mm:890
Details:  Failed to start Instruments daemon on device “e46fca3fb0c244f4f7fd2455ac8d3781cc258f2d”: Error Domain=com.apple.dtdevicekit Code=-402653150 "The service is invalid." UserInfo={NSLocalizedFailureReason=Please check your setup and try again. (0xE8000022)., com.apple.dtdevicekit.stacktrace=(
	0   DTDeviceKitBase                     0x0000000110128d72 DTDKCreateNSError + 113
	1   DTDeviceKitBase                     0x0000000110129473 DTDK_AMDErrorToNSError + 741
	2   DTDeviceKitBase                     0x000000011013967d __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 302
	3   DTDeviceKitBase                     0x0000000110138d17 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
	4   DTDeviceKitBase                     0x000000011012baa4 __DTDKExecuteInSession_block_invoke + 38
	5   DTDeviceKitBase                     0x000000011012b0d2 __DTDKExecuteWithConnection_block_invoke_2 + 477
	6   DTDeviceKitBase                     0x000000011012aece __DTDKExecuteWithConnection_block_invoke + 107
	7   libdispatch.dylib                   0x00007fff9a65e40b _dispatch_client_callout + 8
	8   libdispatch.dylib                   0x00007fff9a65f9f2 _dispatch_barrier_sync_f_invoke + 74
	9   DVTFoundation                       0x000000010f7e5e76 DVTDispatchBarrierSync + 62
	10  DVTFoundation                       0x000000010f7c63de -[DVTDispatchLock performLockedBlock:] + 116
	11  DTDeviceKitBase                     0x000000011012add8 DTDKExecuteWithConnection + 223
	12  DTDeviceKitBase                     0x000000011012ba2e DTDKExecuteInSession + 121
	13  DTDeviceKitBase                     0x0000000110138c50 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 117
	14  DVTFoundation                       0x000000010f7e5667 __DVTDispatchAsync_block_invoke + 293
	15  libdispatch.dylib                   0x00007fff9a66993d _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00007fff9a65e40b _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00007fff9a66229b _dispatch_root_queue_drain + 1890
	18  libdispatch.dylib                   0x00007fff9a661b00 _dispatch_worker_thread3 + 91
	19  libsystem_pthread.dylib             0x00007fff977a54de _pthread_wqthread + 1129
	20  libsystem_pthread.dylib             0x00007fff977a3341 start_wqthread + 13
), NSLocalizedRecoverySuggestion=Please check your setup and try again. (0xE8000022)., NSLocalizedDescription=The service is invalid.}
Object:   <DTDKRemoteDeviceConnection: 0x7fed656f7520>
Method:   -instrumentsConnection
Thread:   <NSThread: 0x7fed63c0b6e0>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
warning MT1043: Failed to launch the application using the instrumeLaunching 'com.company.Prototype' on the device 'dev’s iPhone'
nts service. Will try launching the app using gdb service.
warning MT1108: Could not find developer tools for this 10.0 (14A5261v) device. Please ensure you are using a compatible Xcode version and then connect this device to Xcode to install the development support files.
error MT1007: Failed to launch the application '/Users/dev/Documents/Projects/PrototypeMono/Prototype.MonoTouch/bin/iPhone/Debug/build-iphone5.1-10.0/PrototypeMonoTouch.app' on the device 'dev’s iPhone': Look for earlier warnings returned: 0x454. You can still launch the application manually by tapping on it.
Comment 32 Rolf Bjarne Kvinge [MSFT] 2016-06-29 13:21:27 UTC
@Songtive,

It looks like you installed iOS 10 on the device, but you're still using Xcode 7.3 in Xamarin Studio:

> warning MT1108: Could not find developer tools for this 10.0 (14A5261v) device. Please ensure you are using a compatible Xcode version and then connect this device to Xcode to install the development support files.

IIRC at the moment there are no versions of Xamarin Studio that work with Xcode 8, so until that's the case, you'll have to launch the app by tapping on it (or use a device with iOS 9 instead).
Comment 33 Songtive Team 2016-06-29 13:29:59 UTC
I see. Thanks Rolf!
Comment 34 Danish Akhtar 2016-07-04 12:29:26 UTC
I have tried to reproduce this issue with builds mentioned in Bug description but not able to reproduce it. 

iOS application is deployed and launched successfully on device iOS 9.3.2 with Xcode 7.3.1.

Please let me know are you guys still getting this issue? Or I have to do something more here to reproduce this issue.

Thanks!
Comment 35 Shruti 2016-07-07 08:04:42 UTC
@Rolf, We are not able to reproduce this issue here. Could you please help here to reproduce it. We can't verify this issue until we reproduce it.
Comment 36 Brendan Zagaeski (Xamarin Team, assistant) 2016-07-07 15:39:56 UTC
Unfortunately, as discussed Comment 13, the exact conditions necessary to replicate this issue are not known.  User verifications such as Comment 18 will most likely have to suffice for this bug.
Comment 37 Akash Amin 2016-07-08 11:18:26 UTC
Is there any solution for this. I can debug my application on simulator but not on Device. I tested on both of my device ipad 2 and iphone 5s but debug doesn't work. I think i'm on the latest version of Xamarin. As in the comments above is this resolved in another version of Xamarin which is yet to be released?

The error message in the logs similar to the errors above :

Xamarin.Messaging.Exceptions.MonotouchException: warning HE0041: Error while processing device notifications: NotificationCallback with unknown message: 5

Device Info :

iPhone 5S with iOS version : 9.3.2

Version Info :

Microsoft Visual Studio Community 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Community

Xamarin   4.1.1.3 (34a92cd)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Forms Player   1.0
Preview Xamarin.Forms XAML on devices and simulators, with support for data-binding via JSON dummy view models.

Xamarin.Android   6.1.1.1 (7db2aac)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.8.1.4 (3cf8aae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 38 Brendan Zagaeski (Xamarin Team, assistant) 2016-07-08 16:51:01 UTC
@Akash:

- See Comment 13 for a possible in-place patch you can apply to the Stable channel.

- Note the comment "The next service release will have this fix." in Comment 20 and the assigned target milestone field of C7SR1 "Cycle 7 – Service Release 1" [1, 2] for the timing of inclusion of the fix in published builds.

[1] https://releases.xamarin.com/beta-release-cycle-7-service-release-1/
[2] See also: "41655 - [mtouch] "Could not kill the application" on https://developer.xamarin.com/releases/ios/xamarin.ios_9/xamarin.ios_9.8/
Comment 40 Stefan Jansson 2016-07-11 19:02:41 UTC
When can we expect this Service release?
Comment 41 Brendan Zagaeski (Xamarin Team, assistant) 2016-07-11 19:28:13 UTC
@Stefan, as per Comment 38:

> - Note the comment "The next service release will have this fix." in
> Comment 20 and the assigned target milestone field of C7SR1 "Cycle 7 –
> Service Release 1" [1, 2] for the timing of inclusion of the fix in
> published builds.

> [1] https://releases.xamarin.com/beta-release-cycle-7-service-release-1/
> [2] See also: "41655 - [mtouch] "Could not kill the application" on https://developer.xamarin.com/releases/ios/xamarin.ios_9/xamarin.ios_9.8/


Clicking through on those 2 links, you would read that:

(a) [1] "Cycle 7 – Service Release 1" is currently in the Beta channel as of July 6, 2016, and [2] that Beta version includes the candidate fix for this bug.

(b) The service release is scheduled to be promoted to the Stable channel during the month of July.
Comment 42 Timothy Lee Russell 2016-07-12 04:32:42 UTC
I downgraded from the Alpha channel to the Beta channel...

But, like @AkashAmin, I am experiencing the following message as well. App launches manually but no debugging ability.

Thanks,
Timothy

===

Xamarin.VisualStudio.IOS.Messaging.State.ServerStateContext Information: 0 : [2016-07-11 21:02:58.6637] Connected to the Mac MacBookAir.local (192.168.1.166) with Full support.
Xamarin.Messaging.Client.MessagingClient Error: 0 : [2016-07-11 21:18:05.7137] An error occured on the receiver while executing a post for topic xvs/idb/4.1.1.3/launch-app and client vs3520timot
Xamarin.Messaging.Exceptions.MessagingRemoteException: An error occured on client IDB4113 while executing a reply for topic xvs/idb/4.1.1.3/launch-app ---> Xamarin.Messaging.Exceptions.MonotouchException: warning HE0041: Error while processing device notifications: NotificationCallback with unknown message: 5

  at Xamarin.Messaging.IDB.MTouch+<RunAsync>d__6.MoveNext () <0x6b5d8a0 + 0x007e3> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x6be76e8 + 0x0002b> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x6be8548 + 0x000bb> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x6be84a8 + 0x00083> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x20fb1f0 + 0x00033> in <filename unknown>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x6bbe708 + 0x00013> in <filename unknown>:0 
  at Xamarin.Messaging.IDB.MTouch+<DeployAsync>d__4.MoveNext () <0x6be4768 + 0x0032f> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---

===

Microsoft Visual Studio Enterprise 2015
Version 14.0.25421.03 Update 3
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Enterprise

Architecture and Modeling Tools   00322-90000-01390-AA531
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Microsoft Visual Studio Tools for Applications 2015   00322-90000-01390-AA531
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015   00322-90000-01390-AA531
Microsoft Visual Basic 2015

Visual C# 2015   00322-90000-01390-AA531
Microsoft Visual C# 2015

Visual C++ 2015   00322-90000-01390-AA531
Microsoft Visual C++ 2015

ASP.NET and Web Tools 2015.1   14.1.20624.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9   14.0.20316.0
Azure App Service Tools v2.9

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.0.6000.0
Microsoft Azure Data Lake Tools for Visual Studio

Command Task Runner   1.2.28
Adds support for command line batch files in Visual Studio 2015's Task Runner Explorer. Supports .cmd, .bat, .ps1 and .psm1 files.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DataFactoryProject   1.0
Microsoft Data Factory Package

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

LLBLGen Pro Designer   5.0
The LLBLGen Pro designer integrated inside Visual Studio.

Microsoft .NET Core Tools (Preview 2)   14.1.20624.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Data Factory Node Node   1.0
Azure Data Factory extension for Visual Studio Server Explorer.

Microsoft Azure HDInsight HQL Service   2.0.6000.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.6000.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.7
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.7.30818.1601

Microsoft Azure Tools   2.8
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.8.40211.2

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.40323.3

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

ReAttach   1.1
Gives you an easy way to ReAttach to prior debugging targets. For more information, see http://visualstudiogallery.msdn.microsoft.com/8cccc206-b9de-42ef-8f5a-160ad0f017ae.

SourceGear Vault Professional Visual Studio Enhanced Client   8.0.1.30299
SourceGear Vault Professional Visual Studio Enhanced Client

SourceGear Vault Professional Visual Studio Work Item Client   8.0.1.30299
SourceGear Vault Professional Visual Studio Work Item Client

SQL Server Analysis Services   13.0.1601.5
Microsoft SQL Server Analysis Services Designer 
Version 13.0.1601.5

SQL Server Data Tools   14.0.60525.0
Microsoft SQL Server Data Tools

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 13.0.1601.5

SQL Server Reporting Services   13.0.1601.5
Microsoft SQL Server Reporting Services Designers 
Version 13.0.1601.5

Telerik ASP.NET AJAX VSExtensions   2016.2.603.0
Telerik UI for ASP.NET AJAX VSExtensions

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   1.8.34.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25420.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.1.1.3 (34a92cd)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Inspector Support   0.3.2.3 (1b526e6)
Adds support for inspecting Xamarin and WPF apps.

Xamarin.Android   6.1.1.1 (7db2aac)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   9.8.1.4 (3cf8aae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 43 Fredrik Haglund 2016-08-18 21:27:25 UTC
If you find this thread through Google but have issues with debugging from Xamarin in Visual Studio (version 4.1, 4.1.1 and 4.1.2) have a look at similar Bug #43239.