diff --git a/lib/fastlane/plugin/stream_actions/actions/install_ios_runtime.rb b/lib/fastlane/plugin/stream_actions/actions/install_ios_runtime.rb index dcb49b0..de92941 100644 --- a/lib/fastlane/plugin/stream_actions/actions/install_ios_runtime.rb +++ b/lib/fastlane/plugin/stream_actions/actions/install_ios_runtime.rb @@ -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") @@ -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 diff --git a/lib/fastlane/plugin/stream_actions/version.rb b/lib/fastlane/plugin/stream_actions/version.rb index 9404390..64bb034 100755 --- a/lib/fastlane/plugin/stream_actions/version.rb +++ b/lib/fastlane/plugin/stream_actions/version.rb @@ -1,5 +1,5 @@ module Fastlane module StreamActions - VERSION = '0.3.65' + VERSION = '0.3.66' end end