diff --git a/lib/motion/project.rb b/lib/motion/project.rb index e4f29247..55e658f4 100644 --- a/lib/motion/project.rb +++ b/lib/motion/project.rb @@ -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. diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index b0b65523..85770768 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -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