Skip to content

Instantly share code, notes, and snippets.

@buk
Created October 17, 2012 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buk/3905816 to your computer and use it in GitHub Desktop.
Save buk/3905816 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'ipa_reader'
require 'plist'
require 'builder'
ipa_file = IpaReader::IpaFile.new("AdhocServerTest.ipa")
puts name = "Name:#{ipa_file.name}"
title = "#{ipa_file.name}"
puts bundleId = "Bundle Identifier: #{ipa_file.bundle_identifier}"
puts version = "Version: #{ipa_file.version}"
File.open(title + '.plist', 'w') do |f|
f.puts '<?xml version=\"1.0" encoding=\"UTF-8\"?>'
f.puts '<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">'
f.puts '<plist version=\"1.0\">'
f.puts '<dict>'
f.puts '<key>items</key>'
f.puts '<array>'
f.puts '<dict>'
f.puts '<key>assets</key>'
f.puts '<array>'
f.puts '<dict>'
f.puts '<key>kind</key>'
f.puts '<string>software-package</string>'
f.puts '<key>url</key>'
f.puts '<string>URL</string>'
f.puts '</dict>'
f.puts '</array>'
f.puts '<key>metadata</key>'
f.puts '<dict>'
f.puts '<key>bundle-identifier</key>'
f.puts '<string>#{ipa_file.bundle_identifier}</string>'
f.puts '<key>bundle-version</key>'
f.puts '<string>1.0</string>'
f.puts '<key>kind</key>'
f.puts '<string>software</string>'
f.puts '<key>title</key>'
f.puts '<string>AdhocServerTest</string>'
f.puts '</dict>'
f.puts '</dict>'
f.puts '</array>'
f.puts '</dict>'
f.puts '</plist>'
f.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment