Class: Fastlane::Actions::ResetSimulatorContentsAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/reset_simulator_contents.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, return_type, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.aliasesObject



36
37
38
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 36

def self.aliases
  ["reset_simulators"]
end

.authorsObject



48
49
50
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 48

def self.authors
  ["danramteke"]
end

.available_optionsObject



24
25
26
27
28
29
30
31
32
33
34
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 24

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :ios,
                                 short_option: "-i",
                                 env_name: "FASTLANE_RESET_SIMULATOR_VERSIONS",
                                 description: "Which versions of Simulators you want to reset content and settings, this does not remove/recreate the simulators",
                                 is_string: false,
                                 optional: true,
                                 type: Array)
  ]
end

.categoryObject



62
63
64
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 62

def self.category
  :misc
end

.descriptionObject



20
21
22
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 20

def self.description
  "Shutdown and reset running simulators"
end

.example_codeObject



56
57
58
59
60
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 56

def self.example_code
  [
    'reset_simulator_contents'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



52
53
54
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 52

def self.is_supported?(platform)
  platform == :ios
end

.outputObject



40
41
42
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 40

def self.output
  nil
end

.return_valueObject



44
45
46
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 44

def self.return_value
  nil
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'fastlane/lib/fastlane/actions/reset_simulator_contents.rb', line 4

def self.run(params)
  if Helper.xcode_at_least?("9")
    UI.important("Resetting simulators currently doesn't work with Xcode 9, stay tuned as we are working to add support for all new tools.")
    return
  end

  if params[:ios]
    params[:ios].each do |os_version|
      FastlaneCore::Simulator.reset_all_by_version(os_version: os_version)
    end
  else
    FastlaneCore::Simulator.reset_all
  end
  UI.success('Simulators reset')
end