I am making use of the awesome ios-sim found on github.
It allows you to run the simulator via the command line and it also allows you to select which simulator (iphone or iPad) to use.
I am able to run my application flawlessly with it. However, I am unsure how to use the arguments passed to my application via the command line.
Has anyone done this or knows how to do this?
./ios-sim launch iTest.app --family ipad --args argument1 argument2
How do I access argument1 and argument2 in the iPhone application?
in the main.m File you can print the arguments with:
You can use this to get the arguments:
I know this is an old question, but I thought I'd post it for future reference.
iOS doesn't support command-line access. This is from Apple's Cocoa Fundamentals Guide, Page 17 http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/WhatIsCocoa/WhatIsCocoa.html#//apple_ref/doc/uid/TP40002974-CH3-SW27