bin/calabash-ios-sim.rb in calabash-cucumber-0.9.167 vs bin/calabash-ios-sim.rb in calabash-cucumber-0.9.168.pre4

- old
+ new

@@ -25,15 +25,27 @@ end def calabash_sim_accessibility - dirs = Dir.glob(File.join(File.expand_path("~/Library"), "Application Support", "iPhone Simulator", "*.*", "Library", "Preferences")) - dirs.each do |sim_pref_dir| + Calabash::Cucumber::SimulatorHelper.stop + old = ['5.*','6.*','7.0*'].map do |x| + Dir.glob(File.join(File.expand_path("~/Library"), "Application Support", "iPhone Simulator", "7.0*", "Library", "Preferences")) + end.flatten + + rest = Dir.glob(File.join(File.expand_path("~/Library"), "Application Support", "iPhone Simulator", "*.*", "Library", "Preferences")) + rest = rest - old + (old+rest).each do |sim_pref_dir| fp = File.expand_path("#{@script_dir}/data/") - FileUtils.cp("#{fp}/com.apple.Accessibility.plist", sim_pref_dir) + if rest.include?(sim_pref_dir) + tgt = 'com.apple.Accessibility-5.1.plist' + else + tgt = 'com.apple.Accessibility.plist' + end + FileUtils.cp("#{fp}/#{tgt}", File.join(sim_pref_dir, 'com.apple.Accessibility.plist')) end + end def calabash_sim_location(args) @@ -123,10 +135,10 @@ end def calabash_sim_device(args) quit_sim - options = ["iPad","iPad_Retina", "iPhone", "iPhone_Retina", "iPhone_Retina_4inch"] + options = ["iPad", "iPad_Retina", "iPhone", "iPhone_Retina", "iPhone_Retina_4inch"] if args.length != 1 or not options.find { |x| x == args[0] } print_usage puts "Unrecognized args: #{args}" puts "should be one of #{options.inspect}" exit(0)