Created
November 9, 2014 07:50
-
-
Save baxang/252842e5914dead5323d to your computer and use it in GitHub Desktop.
Read Info.plist and get a version number from a packaged iOS app distribution file(.ipa).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Check binary version." | |
task :get_ver do | |
require 'rubygems' | |
require 'zip' | |
require 'pathname' | |
require 'cfpropertylist' | |
Zip::File.open('build/iPhoneOS-8.0-Release/WH.ipa') do |file| | |
plist = file.get_entry('Payload/WH.app/Info.plist') | |
content = CFPropertyList::List.new(format: CFPropertyList::List::FORMAT_BINARY, data: plist.get_input_stream.read) | |
data = CFPropertyList.native_types(content.value) | |
data.each do |k, v| | |
puts "#{k} : #{v}" | |
end | |
puts "------" | |
puts data['CFBundleName'] | |
puts data['CFBundleIdentifier'] | |
puts data['CFBundleVersion'] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment