Skip to content

Instantly share code, notes, and snippets.

@joncooper
Created October 26, 2011 18:38
Show Gist options
  • Select an option

  • Save joncooper/1317326 to your computer and use it in GitHub Desktop.

Select an option

Save joncooper/1317326 to your computer and use it in GitHub Desktop.
launch iOS simulator from rake task
def try_to_launch_simulator(target)
ios_sim = `which ios-sim`.strip
if ios_sim.empty?
puts "Please install ios-sim:"
puts "brew install ios-sim, or https://github.com/Fingertips/ios-sim"
exit
else
system_or_exit(%Q[#{ios_sim} launch "#{File.join(build_dir("-iphoneSimulator"), "#{target}")}" --sdk 5.0 --family iphone --stdout /dev/null --stderr /dev/null])
`osascript -e 'tell application "iPhone Simulator" to activate'`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment