Class: Fastlane::Actions::SelectXcodeAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/stream_actions/actions/select_xcode.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.available_optionsObject



21
22
23
24
25
26
27
28
29
# File 'lib/fastlane/plugin/stream_actions/actions/select_xcode.rb', line 21

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :version,
      env_name: 'GITHUB_REPOSITORY',
      description: 'Xcode version'
    )
  ]
end

.descriptionObject



17
18
19
# File 'lib/fastlane/plugin/stream_actions/actions/select_xcode.rb', line 17

def self.description
  'Select Xcode version'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/fastlane/plugin/stream_actions/actions/select_xcode.rb', line 31

def self.is_supported?(platform)
  [:ios].include?(platform)
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fastlane/plugin/stream_actions/actions/select_xcode.rb', line 4

def self.run(params)
  xcodes = sh('ls /Applications | grep Xcode')
  UI.user_error!("Xcode #{params[:version]} is not installed") unless xcodes.include?(params[:version])

  sh("sudo xcode-select -s /Applications/Xcode_#{params[:version]}.app")
  sh('xcodebuild -version')
  sh('xcrun simctl list runtimes | grep iOS')
end