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