From 9bfb8f4ef731689dcf6ae6e30bf6020153ac4e1b Mon Sep 17 00:00:00 2001 From: Watson Date: Sat, 7 Jun 2014 09:30:21 +0900 Subject: [PATCH] [iOS8] add "device_name" parameter Usage: $ rake device_name="iPad Air" We can use the following device name for iOS 8 simulator. "iPhone 4s" "iPhone 5" "iPhone 5s" "iPad 2" "iPad Retina" "iPad Air" "Resizable iPhone" "Resizable iPad" --- lib/motion/project/template/ios.rb | 3 ++- lib/motion/project/template/ios/config.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/motion/project/template/ios.rb b/lib/motion/project/template/ios.rb index dd94bc47..df78543a 100644 --- a/lib/motion/project/template/ios.rb +++ b/lib/motion/project/template/ios.rb @@ -149,7 +149,8 @@ END end end - simulate_device = App.config.device_family_string(family_int, target, retina) + device_name = ENV["device_name"] + simulate_device = App.config.device_family_string(device_name, family_int, target, retina) # Launch the simulator. xcode = App.config.xcode_dir diff --git a/lib/motion/project/template/ios/config.rb b/lib/motion/project/template/ios/config.rb index 858f8f44..6e6a8fe1 100644 --- a/lib/motion/project/template/ios/config.rb +++ b/lib/motion/project/template/ios/config.rb @@ -200,7 +200,7 @@ module Motion; module Project; end end - def device_family_string(family, target, retina) + def device_family_string(device_name, family, target, retina) device = case family when :iphone, 1 "iPhone" @@ -211,7 +211,7 @@ module Motion; module Project; ver = xcode_version[0].match(/(\d+)/) case ver[0].to_i when 6 - device + device_retina_xcode6_string(family, target, retina) + (device_name.nil?) ? device + device_retina_xcode6_string(family, target, retina) : device_name when 5 device + device_retina_xcode5_string(family, target, retina) else