mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 22:42:55 +08:00
rake simulator's 'retina' option can now take 3.5 and 4 as values (for iphone5 retina mode)
This commit is contained in:
@@ -81,13 +81,13 @@ task :simulator => ['build:simulator'] do
|
||||
else
|
||||
App.config.device_family_ints[0]
|
||||
end
|
||||
retina = ENV['retina'] == 'true'
|
||||
retina = ENV['retina']
|
||||
|
||||
# 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, retina)
|
||||
simulate_device = App.config.device_family_string(family_int, target, retina)
|
||||
if `/usr/bin/defaults read com.apple.iphonesimulator "SimulateDevice"`.strip != simulate_device
|
||||
system("/usr/bin/killall \"iPhone Simulator\" >& /dev/null")
|
||||
system("/usr/bin/defaults write com.apple.iphonesimulator \"SimulateDevice\" \"'#{App.config.device_family_string(family_int, retina)}'\"")
|
||||
system("/usr/bin/defaults write com.apple.iphonesimulator \"SimulateDevice\" \"'#{simulate_device}'\"")
|
||||
end
|
||||
|
||||
# Launch the simulator.
|
||||
|
||||
@@ -464,14 +464,23 @@ EOS
|
||||
end
|
||||
end
|
||||
|
||||
def device_family_string(family, retina)
|
||||
def device_family_string(family, target, retina)
|
||||
device = case family
|
||||
when :iphone, 1
|
||||
"iPhone"
|
||||
when :ipad, 2
|
||||
"iPad"
|
||||
end
|
||||
retina ? device + " (Retina)" : device
|
||||
case retina
|
||||
when 'true'
|
||||
device + (family == 1 and target >= '6.0' ? ' (Retina 4-inch)' : ' (Retina)')
|
||||
when '3.5'
|
||||
device + ' (Retina 3.5-inch)'
|
||||
when '4'
|
||||
device + ' (Retina 4-inch)'
|
||||
else
|
||||
device
|
||||
end
|
||||
end
|
||||
|
||||
def device_family_ints
|
||||
|
||||
Reference in New Issue
Block a user