Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild commands failed to generate iPA

In xcode 9.2 I'm generating archive using automatic signing, Developer certificate and provisioning profile are generating through xcodebuild commands using -allowProvisioningUpdates key.

But when generating iPA through xcodebuild commands with that archive getting below error.

Details:  Unable to close provisioning ledger entry because not all of its subentries are closed
Object:   <IDEProvisioningLedgerEntry: 0x7f925ced3840>
Method:   -closeWithError:
Thread:   <NSThread: 0x7f925a734df0>{number = 4, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

Using Xcodebuild command to generate archive

xcodebuild -exportArchive -archivePath '/path/to/archive/Test.xcarchive' -exportOptionsPlist '/path/to/exportOptions/ExportOptions.plist' -exportPath '/path/to/archive/' PRODUCT_BUNDLE_IDENTIFIER="bundle_id" DEVELOPMENT_TEAM="development_team_id" -allowProvisioningUpdates

And Export plist options details:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>ad-hoc</string>
    <key>signingCertificate</key>
    <string>iPhone Developer</string>
    <key>signingStyle</key>
    <string>automatic</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>TEAM_ID</string>
    <key>uploadBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
</dict>
</plist>

Using Xcode GUI all working fine, Developer, Distribution certificate and provisioning profile are generating

But when using xcodebuild in terminal only developer certificate is generating and developer provisioning profile when archiving. but Distribution certificate is not generating through xcodbuild.

Can any one help me!

like image 341
Ashish Shah Avatar asked Mar 14 '18 07:03

Ashish Shah


1 Answers

I hope it's useful.

xcodebuild archive -workspace "xxx.xcworkspace" -scheme "xxx" -configuration Debug -archivePath build/xxx.xcarchive

xcodebuild -exportArchive -archivePath build/xxx.xcarchive -exportPath build/xxx -exportOptionsPlist ExportOptions.plist

enter image description here

like image 127
PhuocLuong Avatar answered Oct 27 '22 03:10

PhuocLuong