Created
May 2, 2012 16:23
-
-
Save jonathanpenn/2577939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is part of a rakefile I use for UI Automation that's part of an | |
# upcoming (secret) project that I hope to announce soon. | |
# You need to set the $app_bundle global variable to point to the application's | |
# bundle on disk. Then hand in 1 for iPhone or 2 for iPad to this function | |
# and it will manipulate the plist of the device. | |
def pick_simulator_device index | |
# For now, the only way to tell UI Automation to run the iPad or iPhone | |
# simulator is to change the app bundle plist to require only that device. | |
sh %(/usr/libexec/PlistBuddy #{$app_bundle}/Info.plist \ | |
-c "Delete :UIDeviceFamily" \ | |
-c "Add :UIDeviceFamily array" \ | |
-c "Add :UIDeviceFamily: integer #{index}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment