fix a bug which iOS simulator will be re-launched at every time with `rake'

RM-52 Should not re-launch iOS simulator at every time with `rake'
This commit is contained in:
Watson
2013-02-26 13:31:00 +09:00
parent 8d5450105f
commit 5573cc442a

View File

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