Skip to content

Commit

Permalink
Find altool using xcrun instead of hard-coding the tool path
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksym Grebenets committed May 20, 2019
1 parent d9ee17d commit 8c55731
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/fastlane/plugin/altool/actions/altool_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 8c55731

Please sign in to comment.