I have a cross-platform app and use command-line arguments for debug testing and hidden/developer features.
On iOS I still have a main(argc,argv)
entry-point - is it possible to pass parameters in via XCode? If so, would this only apply to debug builds or would it perhaps depend on the provisioning type in use?
Asked
Active
Viewed 1,083 times
0

Mr. Boy
- 60,845
- 93
- 320
- 589
-
Yep, as Armand says, there is a way to set command line parms in Xcode. I use this a fair amount for testing. Once "live" on a phone, of course, you can't use this, since there's no way for the user to specify parms. – Hot Licks Mar 08 '14 at 13:41
-
How do you actually _use_ them though? I pass them to `UIApplicationMain()` but then how does my app-delegate access them? – Mr. Boy Mar 08 '14 at 14:44
-
3@John You can access them by using [NSProcessInfo class](https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/Classes/NSProcessInfo_Class/Reference/Reference.html), `[[NSProcessInfo processInfo] arguments]` – Emmanuel Mar 08 '14 at 15:48
1 Answers
0
to set param at debug time : How do you specify command line arguments in Xcode 4?
As you don't manage app lunch in prod, I would like to say don't use this (including in debug except if you tag your code to be there only at debug). more than 1 possible lunch (user click icon, notification incoming....)

Community
- 1
- 1

Armand DOHM
- 1,121
- 1
- 7
- 9