Bug 41083 - mtouch with mlaunch problems
Summary: mtouch with mlaunch problems
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: 10.0.0 (C8)
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2016-05-13 19:50 UTC by Martin Baulig
Modified: 2016-07-12 09:10 UTC (History)
6 users (show)

Tags:
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:
Status:
VERIFIED FIXED

Description Martin Baulig 2016-05-13 19:50:36 UTC
There are three problems when using mtouch to launch an app in the simulator.

1.) mtouch fails to find mlaunch.

This is because it's installed in /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.IPhone/mlaunch.app/Contents/MacOS/mlaunch
where mtouch fails to find it.

2.) The "--sdkroot=" argument is mandatory, not optional.

3.) The "--device=" argument is mandatory - omitting it omits in a crash when Xamarin.Launcher.Driver.LaunchSimulator() calls GetSimulatorDevice(null).
Comment 1 Sebastien Pouliot 2016-05-13 20:39:47 UTC
> 1.) mtouch fails to find mlaunch.

Fixed in PR 51
https://github.com/xamarin/xamarin-macios/pull/51


> 2.) The "--sdkroot=" argument is mandatory, not optional.

error MT0100: The option '--sdkroot' is required.

What makes you think it should not be required ? do we have out-of-date documentation somewhere ?


> 3.) The "--device=" argument is mandatory

Indeed, and it presently fails in a non-helpful way.

Failed to launch the simulator: Object reference not set to an instance of an object
error MT1008: Failed to launch the simulator: Object reference not set to an instance of an object
Comment 2 Sebastien Pouliot 2016-05-14 15:19:39 UTC
#2 is still unclear (about optional) but the help message was still mentioning a default of /Developer/ which is not correct (for both mtouch and mlauch).

That's fixed in (a second commit to) PR #51 (mtouch part + maccore/maciostools bumps)
Comment 3 Sebastien Pouliot 2016-05-17 21:41:24 UTC
#3 fixed in maciostools/master 67b20f63a69c53a126d3a9e1121345f8c5a920a9

Bumps in https://github.com/xamarin/xamarin-macios/pull/61
Comment 4 Sebastien Pouliot 2016-05-18 00:48:49 UTC
Fixed in xamarin-macios/master e726b5ab7e52bd7ece9db712d301ab5047e76560
Comment 5 Saurabh 2016-07-01 08:48:24 UTC
I am not sure which build I can use to reproduce this issue.

I have checked this Issue with latest master build (XI 9.9.2.129)and observed that application getting launched on simulator using mtouch command. Below is my output:

Hello:bin 360_macmini$ ./mtouch -launchsim /Users/360_macmini/Desktop/Xamarin/HelloiOS/HelloiOS/bin/iPhoneSimulator/Debug/HelloiOS.app/
warning MT0061: No Xcode.app specified (using --sdkroot), using the system Xcode as reported by 'xcode-select --print-path': /Applications/Xcode.app/Contents/Developer
2016-07-01 14:06:28.346 mlaunch[1998:70396] Failed to wait for launchctl print process 2000: 10 No child processes

Please let me know if there is anything else I can check here.
Comment 7 Saurabh 2016-07-12 09:10:46 UTC
For Item 1, I am not seeing such type of Issue with latest master build (XI 9.9.0.157) mentioned in comment#4

For Item 2, Gouri raised an issue in doc repository as per comment#6.

For item 3, It requires a maciostools/master bump and this fix is already included in XS master.