Programatic way to Reset Location Warnings in the iOS simulator

393 Views Asked by At

I'd like to find a programatic way to reset the location warnings for the iOS simulator so that it can be automated before test case. I'm specifically trying to incorporate this with the KIF testing framework.

Any API will do, private or public.

1

There are 1 best solutions below

1
On BEST ANSWER

Have you tried to change the application bundle identifier? It is not clean solution but it can help.

You can also change it programmatically writing skript and running it as one of the build phases.

UPDATE

In your Build Phases section of Project configuration add new phase Run Script You can use something like that:

echo $CONFIGURATION
if [ "$CONFIGURATION" == "Debug" ]; then
${SRCROOT}/build.sh
fi

And build.sh could look like this:

#!/bin/bash
newIdentifier = "com.mydomain.myapp_new"
/usr/libexec/PlistBuddy -c "Set : CFBundleIdentifier ${newIdentifier}" "MyApp-Info.plist"

You will find way to incrementally change bundle identifier

You can find more here: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/PlistBuddy.8.html