Bug 6087 - mtouch --launchsim should support more simulator options
Summary: mtouch --launchsim should support more simulator options
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 5.2
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-07-11 20:23 UTC by adam.lickel
Modified: 2013-02-14 13:14 UTC (History)
2 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:
RESOLVED FIXED

Description adam.lickel 2012-07-11 20:23:33 UTC
Currently, the only option I can see is `--device` which is poorly documented.

--device should support retina versions of the iPhone and iPad simulators, and the enumeration should be available in `mtouch -h`

There should also be a way to specify the OS version of the simulator.

This is especially relevant as --stdout and --stderr will not apply once the app has quit (as when you switch these parameters in the simulator's drop down menu.
Comment 1 Sebastien Pouliot 2012-07-16 08:38:17 UTC
If you directly use the `mtouch` command-line tool then your best reference is it's man page, which is available online at:

http://iosapi.xamarin.com/?link=man%3amtouch(1)

This is much better than `mtouch -h` but feel free to comment on it if some options are not documented enough to be useful.

> Currently, the only option I can see is `--device` which is poorly documented.

--device=NUM
    Specify the type of device you want the iOS simulator to simulate. Use 1 for the iPhone, 2 for the iPad.

> --device should support retina versions of the iPhone and iPad simulators

That was not possible last time I checked (API limitation). I'll check again to see if newer SDK allows this now and update this bug report.

> There should also be a way to specify the OS version of the simulator.

The `sdk` option works on the simulator as long as the specified version of the SDK is available (installed) on your system.

e.g. mtouch -sdk=5.0

If you have several Xcode versions installed on your system you might need to use "--sdkroot=PATH" to select the one you want to be used (in case the iOS version you want is only available in one of them).
Comment 2 Sebastien Pouliot 2012-07-16 09:51:32 UTC
Retina is not a 'family' we can set with the existing simulator API, i.e. the only valid value are 0 (use latest), 1 (iPhone) and 2 (iPad). That's also a limitation of the latest Xcode versions I've tested.

AFAICT 'retina' appears to be a configuration option kept by the simulator itself. E.g.

a. run app under iOS simulator (iPhone) - it will be a "normal" (non retina) iPhone
b. switch device to iPhone Retina
c. close the iOS simulator
d. run app again under iOS simulator (iPhone) - it will be a retina iPhone (and --stdout and --stderr should work fine)

We might be able to "push" that before starting the simulator but it likely won't work 100% of the time, e.g. when the simulator process is already running (and reused).
Comment 3 adam.lickel 2012-07-16 13:12:14 UTC
--device=0 is good enough for me.
And, thanks for the note on --sdk. I assumed that only applied to compilation.
Comment 4 Sebastien Pouliot 2012-07-17 10:07:08 UTC
for the record (when I google back on this subject ;-) the values are identical to UIDeviceFamily [1] and that does not include retina devices as separate families.

[1] http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW11
Comment 5 Sebastien Pouliot 2013-02-14 13:14:38 UTC
Future (post 6.2) version of mtouch will allow specify more options to --device. OTOH those new options are configuration-based (no part of the API) and requires to restarts the simulator (about 10 extra seconds) so "1" or "2" is still better in most cases.

e.g. [iphone|ipad][,retina][,tall]