This has been vexing me for a while today. In my iOS project, I have a prebuild script which runs before compiling the "UITests" target. It adds the git branch the project was built from to the plist. Pretty handy, and I have it working for my main target/main bundle as well.
It seems to update the test's Info.plist
, but the changes aren't reflected when I slap down a breakpoint and dump the bundle in lldb, I get this:
(lldb) po [[NSBundle bundleForClass:[self class]] infoDictionary]
{
...
"GIT_BRANCH" = "";
...
//other bundle crap
}
Which is odd, because if I look at the test target's plist in xcode, I see:
So, am I crazy? How could this not be in my compiled tests? Thanks for any help. It "work"s the second time I run it, but that's not going to cut it. I need a cleanup script to run after compilation so that the dirty plist doesn't muck up my source control.
I got the idea from the comments on this other thread's answer: https://stackoverflow.com/a/29515958/4040373