Skip to content

Instantly share code, notes, and snippets.

@KrauseFx
Created September 2, 2014 08:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save KrauseFx/db0ea9c884465e507602 to your computer and use it in GitHub Desktop.
Save KrauseFx/db0ea9c884465e507602 to your computer and use it in GitHub Desktop.
iTunesConnect: Receive the app identifier of the next app to be uploaded (Waiting for Upload status), since you can not specify which app you want to deploy next (http://stackoverflow.com/questions/7568420/how-to-perform-ios-app-validation-from-the-command-line#comment23525642_7569194)
# encoding: utf-8
require 'pty'
require 'pry'
command = "xcrun -sdk iphoneos Validation -online -upload -verbose notHere.ipa"
# upload it now: http://stackoverflow.com/questions/7568420/how-to-perform-ios-app-validation-from-the-command-line
output = ''
begin
PTY.spawn(command) do |stdin, stdout, pid|
begin
stdin.each do |line|
output += line
if line.include?"ExistingBundleIdentifier" or line.include?"ReservedBundleIdentifier"
identifier = line.split('"')[1]
puts identifier
exit
end
if line.include?"warning: Can't connect to iTunesConnect"
puts output
raise "Some error when trying to fetch the app identifier"
end
end
rescue Errno::EIO
binding.pry
puts "Errno:EIO error, but this probably just means " +
"that the process has finished giving output"
end
end
rescue PTY::ChildExited
puts "The child process exited!"
binding.pry
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment