From 8c55731867b3e42904f2801829a4bf2ff5a05252 Mon Sep 17 00:00:00 2001 From: Maksym Grebenets Date: Mon, 20 May 2019 15:09:10 +1000 Subject: [PATCH] Find altool using xcrun instead of hard-coding the tool path --- .../plugin/altool/actions/altool_action.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/fastlane/plugin/altool/actions/altool_action.rb b/lib/fastlane/plugin/altool/actions/altool_action.rb index a8bcf09..867339e 100644 --- a/lib/fastlane/plugin/altool/actions/altool_action.rb +++ b/lib/fastlane/plugin/altool/actions/altool_action.rb @@ -4,9 +4,10 @@ module Fastlane module Actions class AltoolAction < Action - ALTOOL= File.expand_path('/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool') - puts ALTOOL def self.run(params) + altool = `xcrun -f altool`.chomp + UI.message("altool binary doesn't exist at path: #{altool}") unless File.exist?(altool) + UI.message(" ----altool binary exists on your machine----- ") altool_app_type = params[:altool_app_type] @@ -19,7 +20,7 @@ def self.run(params) UI.message("========Validating and Uploading your ipa file to iTunes Connect=========") command = [ - ALTOOL, + altool, '--upload-app', '-t', altool_app_type, @@ -33,7 +34,7 @@ def self.run(params) altool_output_format ] Actions.sh(command.join(' ')) - UI.message("========It maight take so long time to fully upload your IPA files=========") + UI.message("========It might take long time to fully upload your ipa file=========") end def self.description @@ -50,7 +51,7 @@ def self.return_value def self.details # Optional: - "This plugin can be used for uploading ipa files to iTunes Connect using altool rahter than using ITMSTransporter.. Currently Fastlane deliver upload an ipa file using iTMSTransporter tool. There is another slick command line too called altool that can be used to upload ipa files as well" + "This plugin can be used for uploading ipa files to iTunes Connect using altool rather than using ITMSTransporter.. Currently Fastlane deliver upload an ipa file using iTMSTransporter tool. There is another slick command line too called altool that can be used to upload ipa files as well" end def self.available_options @@ -79,16 +80,14 @@ def self.available_options description: "Your Apple ID for iTunes Connects. This usually FASTLANE_USER environmental variable", is_string: true, default_value: ENV["FASTLANE_USER"], - optional: false, - ), + optional: false), FastlaneCore::ConfigItem.new(key: :altool_password, env_name: "ALTOOL_PASSWORD", description: "Your Apple ID Password for iTunes Connects. This usually FASTLANE_PASSWORD environmental variable", is_string: true, default_value: ENV["FASTLANE_PASSWORD"], - optional: true, - ), + optional: true), FastlaneCore::ConfigItem.new(key: :altool_output_format, env_name: "ALTOOL_OUTPUT_FORMAT",