xcodebuild not copying file from .app

后端 未结 2 2064
青春惊慌失措
青春惊慌失措 2020-12-23 18:48

I\'ve created a signed .xcarchive file using the xcodebuild command.

Inside the .xcarchive is a .app file. Inside the .app is a file called archived-expanded-entitle

相关标签:
2条回答
  • 2020-12-23 19:19

    This is indeed a weird behaviour of xcodebuild, but you can still use the exportArchive command and specify the provisioning profile using exportProvisioningProfile:

    xcodebuild -exportArchive -exportFormat IPA \
      -archivePath /Path/To/Archive/name.xcarchive \
      -exportPath /Path/To/Archive/name.ipa \
      -exportProvisioningProfile 'PROVISIONING_PROFILE_NAME'
    

    This will reembed the provisioning profile within the app and you won't actually need to speciify the code signing identity again, because the archive should already be signed during the archive process.

    0 讨论(0)
  • 2020-12-23 19:20

    My answer would be considered a workaround, but it solved the problem. I do not know why the one file was not being copied over, but I found a way so it wasn't important.

    Replace the 2nd xcodebuild command with this, which utilizes xcrun:

    /usr/bin/xcrun -sdk iphoneos PackageApplication -v /Path/To/Archive/name.xcarchive/Products/Applications/name.app -o /Path/To/Archive/DiplomatStaples.ipa --sign "identity" - -embed "provProfile"
    

    This creates an IPA using the xcarchive and then re-embeds the identity and the provisioning profile, so even though the same error as above still occurs and is printed out,the "double dip" with the code signing identity and provisioning profile makes it meaningless. I can now install the app on devices.

    For inquiring minds: The reason I'm not just using xcrun in the first place is because even if I specify a prov profile and signing identity, xcrun will use the embedded profile and signing identity in the project based on the configuration (Debug, AppStore, Release, etc) that I specify. xcodebuild will actually sign with the certs I provide it.

    The goal of this operation was to remove the need for provisioning profile certs that the CI system required from developer machines, enabling testing the "AppStore" configuration to be signed with AdHoc distribution certs, and enabling re-signing of the xcarchive later on with the actual App Store distribution certs.

    0 讨论(0)
提交回复
热议问题