quit the simulator app before changing the SimulateDevice variable, to avoid bugs such as the ipad simulator using the iphone frame

This commit is contained in:
Laurent Sansonetti
2012-07-12 21:44:24 +02:00
parent 4244f0720b
commit 83aba5d33c

View File

@@ -90,7 +90,11 @@ task :simulator => ['build:simulator'] do
retina = ENV['retina'] == 'true'
# Configure the SimulateDevice variable (the only way to specify if we want to run in retina mode or not).
sh "/usr/bin/defaults write com.apple.iphonesimulator \"SimulateDevice\" \"'#{App.config.device_family_string(family_int, retina)}'\""
simulate_device = App.config.device_family_string(family_int, retina)
if `/usr/bin/defaults read com.apple.iphonesimulator "SimulateDevice"`.strip != simulate_device
system("/usr/bin/killall \"iPhone Simulator\"")
system("/usr/bin/defaults write com.apple.iphonesimulator \"SimulateDevice\" \"'#{App.config.device_family_string(family_int, retina)}'\"")
end
# Launch the simulator.
xcode = App.config.xcode_dir