Class: Fastlane::Actions::CreateSimulatorDevicesAction
- Inherits:
-
Fastlane::Action
- Object
- Fastlane::Action
- Fastlane::Actions::CreateSimulatorDevicesAction
- Defined in:
- lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb
Overview
Create simulator devices.
Constant Summary collapse
- UI =
::Fastlane::UI
Instance Attribute Summary collapse
-
#shell_helper ⇒ Object
Returns the value of attribute shell_helper.
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
-
.is_supported?(_platform) ⇒ Boolean
rubocop:disable Naming/PredicatePrefix.
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Instance Attribute Details
#shell_helper ⇒ Object
Returns the value of attribute shell_helper.
20 21 22 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 20 def shell_helper @shell_helper end |
Class Method Details
.authors ⇒ Object
95 96 97 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 95 def self. ['nekrich'] end |
.available_options ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 63 def self. [ ::FastlaneCore::ConfigItem.new(key: :devices, env_name: 'SCAN_DEVICES', description: 'A list of simulator devices to install (e.g. "iPhone 16")', is_string: false, default_value: 'iPhone 16'), ::FastlaneCore::ConfigItem.new(key: :cache_dir, description: 'The directory to cache the simulator runtimes', is_string: true, optional: true, default_value: "#{Dir.home}/.cache/create_simulator_devices"), ::FastlaneCore::ConfigItem.new(key: :verbose, env_name: 'VERBOSE', description: 'Verbose output', is_string: false, optional: true, default_value: ::FastlaneCore::Globals.verbose?, default_value_dynamic: true) ] end |
.description ⇒ Object
48 49 50 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 48 def self.description 'Creates simulator devices and installs missing runtimes if needed' end |
.details ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 52 def self.details "This action does it best to create simulator devices. Usage sample: available_simulators_list = create_simulator_devices( devices: ['iPhone 15 (17.0)', 'iPhone 16', 'iPhone 14 (16.3)'] verbose: false )" end |
.is_supported?(_platform) ⇒ Boolean
rubocop:disable Naming/PredicatePrefix
99 100 101 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 99 def self.is_supported?(_platform) # rubocop:disable Naming/PredicatePrefix true end |
.output ⇒ Object
85 86 87 88 89 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 85 def self.output [ ['AVAILABLE_SIMULATOR_DEVICES', 'A list of available simulator devices'] ] end |
.return_value ⇒ Object
91 92 93 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 91 def self.return_value 'Returns a list of available simulator devices' end |
.run(params) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fastlane/plugin/create_simulator_devices/actions/create_simulator_devices_action.rb', line 22 def self.run(params) verbose = params[:verbose] params[:devices] = params[:devices].split(',').map(&:strip) if params[:devices].is_a?(String) required_devices = params[:devices] UI.user_error!('No devices specified') if required_devices.nil? || required_devices.empty? shell_helper = CreateSimulatorDevices::ShellHelper.new(verbose:, action_context: self) runtime_helper = CreateSimulatorDevices::RuntimeHelper.new(cache_dir: params[:cache_dir], shell_helper:, verbose:) runner = CreateSimulatorDevices::Runner.new( runtime_helper: runtime_helper, shell_helper: shell_helper, verbose: verbose ) available_simulator_devices = runner.run(required_devices) Actions.lane_context[SharedValues::AVAILABLE_SIMULATOR_DEVICES] = available_simulator_devices available_simulator_devices end |