Created
September 25, 2013 15:52
-
-
Save diegocstn/6701712 to your computer and use it in GitHub Desktop.
Open Safari Mobile on iOS simulator passing a url with command line ( DRAFT )
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
#!/usr/bin/env ruby | |
basePath = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/" | |
simulatorPath = basePath + "Applications/iPhone\\ Simulator.app/Contents/MacOS/iPhone\\ Simulator -SimulateApplication" | |
sdkPath = basePath + "SDKs/" | |
safariPath = "Applications/MobileSafari.app/MobileSafari" | |
# check arguments | |
if ARGV.count > 3 || ARGV.count < 1 | |
puts "Usage: safarimob url [--sdk 6.1|7.0 ]" | |
exit 0 | |
end | |
# if no sdk is specified, default 7 | |
sdk = ( ARGV[2] ) ? ARGV[2] : 7.0 | |
url = ARGV[0] | |
# build application path with sdk version | |
safariPath = sdkPath+"iPhoneSimulator"+sdk.to_s+".sdk/"+safariPath | |
exec( simulatorPath + " " + safariPath ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment