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

查看:191
本文介绍了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文件进行复制,而在THAT .app文件中,没有archived-expanded-entitlements.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.

这是确切的错误。谷歌和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天全站免登陆