10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/fwtoolkit/cli/ota.rb', line 10
def self.create_ipa(xcarchive_path, ipa_output, dev_id=nil, provisionin_profile=nil)
provisioning_profile = File.expand_path provisioning_profile
raise Thor::Error, "Unable to locate the provisioning profile: #{provisioning_profile}" unless File.exists?(provisioning_profile)
app_path = find_unique! xcarchive_path, '*.app'
raise Thor::Error, "Unable to find any .app file at path: #{xcarchive_path}" unless app_path
ipa_output = File.expand_path ipa_output
cmd_line = "xcrun -sdk iphoneos PackageApplication -v #{app_path} -o #{ipa_output}"
cmd_line += "--sign #{dev_id}" if dev_id
cmd_line += "--embed #{provisioning_profile}" if provisioning_profile
run! "xcrun -sdk iphoneos PackageApplication -v #{app_path} -o #{ipa_output}"
end
|