xcodebuild 不从 .app 复制文件 [英] xcodebuild not copying file from .app

查看:28
本文介绍了xcodebuild 不从 .app 复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 xcodebuild 命令创建了一个签名的 .xcarchive 文件.

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

.xcarchive 里面是一个 .app 文件..app 中有一个名为archived-expanded-entitlements.xcent 的文件.这个文件是我问题的关键.

Inside the .xcarchive is a .app file. Inside the .app is a file called archived-expanded-entitlements.xcent. This file is the key to my problem.

我运行了一个不同的 xcodebuild 命令,该命令从 .xcarchive 创建了一个 .IPA 文件.

I run a different xcodebuild command that creates an .IPA file from the .xcarchive.

创建 IPA 失败,因为 archived-expanded-entitlements.xcent 文件丢失.问题是,xcodebuild 正在创建一个临时目录,它会在其中复制我的 .app 文件,并且在该 .app 文件中,没有存档扩展授权.xcent 文件.

Creating the IPA fails because the archived-expanded-entitlements.xcent file is missing. The thing is, xcodebuild is creating a temporary directory where it copies over my .app file, and inside THAT .app file, there is no archived-expanded-entitlements.xcent file.

除了这个文件外,其他所有文件都在那里.

All the other files are in there except this one.

我运行的命令如下:

这将创建 xcarchive:

This creates the xcarchive:

xcodebuild -project diplomat.xcodeproj -scheme schemeName archive -archivePath /Path/To/Archive/name.xcarchive -configuration AppStore CODE_SIGN_IDENTITY="identity" PROVISIONING_PROFILE=provProfile

这将创建 IPA:

xcodebuild -exportArchive -exportFormat IPA -archivePath /Path/To/Archive/name.xcarchive -exportPath /Path/To/Archive/name.ipa

尽管指定了 .xcarchive 的位置,但它会创建一个临时目录并且不包含重要文件.请注意,archived-expanded-entitlements.xcent 文件是在 .xcarchive 进程(运行的第一个命令)期间创建的,并且在第二个命令运行期间无法复制到临时目录中.

Despite specifying the location of the .xcarchive, it creates a temporary directory and doesn't include the important file. Please note, the archived-expanded-entitlements.xcent file is created during the .xcarchive process (the first command that's run) and fails to copy into the temp directory during the second command run.

这是确切的错误.Google 和 StackOverflow 也产生了类似的错误,但与实际问题无关.

This is the exact error. Google and StackOverflow have yielded similar errors, but nothing with this actual problem.

Checking original app

     + /usr/bin/codesign --verify -vvvv    /var/folders/sl/_wdkd56d5pb05snr559cmcww0000gn/T/D2133E2C-DC66-427C-A3C5-903A88DD0541-  42128-00007ED35037747A/name.app

Program /usr/bin/codesign returned 1 : 

     [/var/folders/sl/_wdkd56d5pb05snr559cmcww0000gn/T/D2133E2C-DC66-427C-A3C5-903A88DD0541-42128-00007ED35037747A/name.app: a sealed resource is missing or invalid

file missing: 

     /private/var/folders/sl/_wdkd56d5pb05snr559cmcww0000gn/T/D2133E2C-DC66-427C-A3C5-903A88DD0541-42128-00007ED35037747A/name.app/archived-expanded-entitlements.xcent
]

Codesign check fails :

      /var/folders/sl/_wdkd56d5pb05snr559cmcww0000gn/T/D2133E2C-DC66-427C-A3C5-903A88DD0541-42128-00007ED35037747A/name.app: a sealed resource is missing or invalid

file missing: 

      /private/var/folders/sl/_wdkd56d5pb05snr559cmcww0000gn/T/D2133E2C-DC66-427C-A3C5-903A88DD0541-42128-00007ED35037747A/name.app/archived-expanded-entitlements.xcent

Done checking the original app

推荐答案

这确实是 xcodebuild 的一个奇怪的行为,但是你仍然可以使用 exportArchive 命令并使用 exportProvisioningProfile 指定配置文件:

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.

这篇关于xcodebuild 不从 .app 复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆