Search code examples
xcodeiosuiapplicationdelegate

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


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?


Solution

  • You can access them using NSProcessInfo object like this,

    NSArray * arguments = [[NSProcessInfo processInfo] arguments];