Programmatically setting iphone simulator location
问题 I've just updated to XCode 4.2 and I see a cool feature that allows me to manually set the device location. Does anyone know of a way to accomplish the same thing programmatically? I'd like to set the location in some unit tests. 回答1: The following AppleScript will let you set the location of the iOS Simulator. It should be possible to integrate this kind of script into a unit test script, or have your script generate the equivalent AppleEvents. tell application "iOS Simulator" activate end