Alex Rivera | Logout

Is there a way to pass command line options to my iOS app from Xcode?

Asked 2011-06-07T23:17:42.483
19

I'm hoping to find a method to pass certain information in to my app when I launch it during testing, so that I can perform special debug tasks. Xcode has a section "Arguments Passed on Launch", and I assumed they would show up in my UIApplicationDelegate's application:didFinishLaunchingWithOptions: but the dictionary that's passed in is always nil.

Am I going about this the wrong way?

Edit
Report

1 Answer

25

You can access them using NSProcessInfo object like this,

NSArray * arguments = [[NSProcessInfo processInfo] arguments];
answered 2011-06-07T23:35:15.200

Your Answer