Method: RunLoop::Core.expect_compatible_simulator_architecture

Defined in:
lib/run_loop/core.rb

.expect_compatible_simulator_architecture(launch_options, sim_control) ⇒ Object

Deprecated.

1.5.2 No public replacement.

Note:

This method is implemented for CoreSimulator environments only; for Xcode < 6.0 this method does nothing.

Raise an error if the application binary is not compatible with the target simulator.

Parameters:

  • launch_options (Hash)

    These options need to contain the app bundle path and a udid that corresponds to a simulator name or simulator udid. In practical terms: call this after merging the original launch options with those options that are discovered.

  • sim_control (RunLoop::SimControl)

    A simulator control object.

Raises:



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/run_loop/core.rb', line 89

def self.expect_compatible_simulator_architecture(launch_options, sim_control)
  RunLoop.deprecated('1.5.2', 'No public replacement.')
  logger = launch_options[:logger]
  if sim_control.xcode_version_gte_6?
    sim_identifier = launch_options[:udid]
    simulator = sim_control.simulators.find do |simulator|
      [simulator.instruments_identifier(sim_control.xcode),
       simulator.udid].include?(sim_identifier)
    end

    if simulator.nil?
      raise "Could not find simulator with identifier '#{sim_identifier}'"
    end

    lipo = RunLoop::Lipo.new(launch_options[:bundle_dir_or_bundle_id])
    lipo.expect_compatible_arch(simulator)
    RunLoop::Logging.log_debug(logger, "Simulator instruction set '#{simulator.instruction_set}' is compatible with #{lipo.info}")
    true
  else
    RunLoop::Logging.log_debug(logger, "Xcode #{sim_control.xcode_version} detected; skipping simulator architecture check.")
    false
  end
end