Ashish Shah
Ashish Shah

Reputation: 2350

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!

Upvotes: 7

Views: 2367

Answers (2)

PhuocLuong
PhuocLuong

Reputation: 739

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

Upvotes: 2

NSAdi
NSAdi

Reputation: 1253

In my organization we have different team_id for Development and Distribution

If it's the same for you then perhaps specifying the Distribution Team ID in the xcodebuild command would fix the problem.

Upvotes: 0

Related Questions