ios - Xcode Environment Variables and Command Line Arguments -


background

i developing ios app connects server. have team of developers run own server unique addresses debugging. our rule source control checkin "production url".

in android have solution works well. solution won't work in ios.

what i've tried

set "command line argument" or "environment variable" in build scheme. problem put "*.xcproject" file get's checked in , causes merge conflicts. if set @ user level fine because .gitignore xcuserdata.

i tried referencing "myconfig.h" file not checked in. if not exist project won't build.

what want do

if developer wants point @ different server set environment variable on mac. "export my_server="http://domain.com/api/". in project file add , environment or command line argument "my_server=$(my_server)".

unfortunately can't figure out how xcode resolve variable on osx machine. seems environment variables resolved on device only. command line arguments seem taken literally.

research i've done

http://qualitycoding.org/production-url/ - not address real issue

http://nshipster.com/launch-arguments-and-environment-variables/

google, apples developer forum , stackoverflow post.

how do in projects ?

is solution use backdoor or file folks change , try not accidentally checkin?

as update found solution solves problem me. using https://github.com/xslim/mobiledevicemanager , script checked in. developer can create custom configuration , copy documents directory. keep production checked in , have runtime check our custum configuration file.

here example of tools usage:

$ mobiledevicemanager -o copy -app "com.domain.myapp" -from ~/.myappconfig/app_override.plist

this way developer can keep custom configuration in home directory (out of source control) without fear of accidental checkin. use process other desktop , android apps fits our process well. has added benefit if testers device failing can point @ custom debug server logging simplify debug process , not need deploy new binary device during internal testing.

i hope can else.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -