Skip to content

Commit

Permalink
Add an option to install runtimes via xcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Sep 2, 2024
1 parent f576069 commit 836311b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions lib/fastlane/plugin/stream_actions/actions/install_ios_runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ def self.run(params)
end

if simulators.empty?
sh("echo 'iOS #{params[:version]} Simulator' | ipsw download xcode --sim") if Dir['*.dmg'].first.nil?
sh("#{params[:custom_script]} #{Dir['*.dmg'].first}")
if params[:tool] == 'ipsw'
sh("echo 'iOS #{params[:version]} Simulator' | ipsw download xcode --sim") if Dir['*.dmg'].first.nil?
sh("#{params[:custom_script]} #{Dir['*.dmg'].first}") if params[:custom_script]
else
sh("sudo xcodes runtimes install 'iOS #{params[:version]}'")
end
UI.success("iOS #{params[:version]} Runtime successfuly installed")
else
UI.important("iOS #{params[:version]} Runtime already exists")
Expand All @@ -31,9 +35,18 @@ def self.available_options
key: :version,
description: 'iOS Version'
),
FastlaneCore::ConfigItem.new(
key: :tool,
description: 'Which tool to use to install the runtime: ipsw or xcodes',
default_value: 'ipsw',
verify_block: proc do |tool|
UI.user_error!('Available options are `ipsw` and `xcodes`') unless ['xcodes', 'ipsw'].include?(tool)
end
),
FastlaneCore::ConfigItem.new(
key: :custom_script,
description: 'Path to custom script to install the runtime'
description: 'Path to custom script to install the runtime (might be required for ipsw)',
optional: true
)
]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/stream_actions/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fastlane
module StreamActions
VERSION = '0.3.65'
VERSION = '0.3.66'
end
end

0 comments on commit 836311b

Please sign in to comment.