Created
November 6, 2014 09:57
-
-
Save onevcat/1bb2477cadbbdc58d0c8 to your computer and use it in GitHub Desktop.
Build an iOS 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
def buildiOS(projectPath, schemeName, archiveName, outPath, ipaName, appId) | |
absolutePath = `pwd`.strip | |
FileUtils.cd("#{projectPath}") do | |
puts "xcodebuild | |
-scheme #{schemeName} | |
-destination generic/platform=iOS | |
-archivePath #{absolutePath}/out/temp/#{archiveName} | |
archive | |
PROVISIONING_PROFILE=\"#{SAMPLE_IOS_APP_PROVISIONING_PROFILE_UUID}\" | |
CODE_SIGN_IDENTITY=\"#{SAMPLE_IOS_APP_CERTIFICATION}\"" | |
puts "Archiving iOS Project, wait..." | |
`xcodebuild \ | |
-scheme #{schemeName} \ | |
-destination generic/platform=iOS \ | |
-archivePath #{absolutePath}/out/temp/#{archiveName} \ | |
archive \ | |
PROVISIONING_PROFILE="#{SAMPLE_IOS_APP_PROVISIONING_PROFILE_UUID}" \ | |
CODE_SIGN_IDENTITY="#{SAMPLE_IOS_APP_CERTIFICATION}"` | |
end | |
puts "Making ipa file from archive..." | |
FileUtils.rm_rf outPath | |
FileUtils.mkdir_p outPath | |
`xcodebuild \ | |
-exportArchive -exportFormat ipa \ | |
-archivePath "./out/temp/#{archiveName}" \ | |
-exportPath "#{outPath}/#{ipaName}" \ | |
-exportProvisioningProfile "#{SAMPLE_IOS_APP_PROVISIONING_PROFILE}"` | |
FileUtils.cp "./res/LineAdsSdkSample.plist", outPath | |
`#{PLIST_BUDDY} -c "Set :items:0:metadata:bundle-identifier #{appId}" #{outPath}/LineAdsSdkSample.plist` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment