ios - 缺少未签名的 xcarchive aps 环境

标签 ios apple-push-notifications xcode11 codesign xcarchive

我想分享未签名的 xcarchive。制作未签名的 xcarchive。我将临时配置文件和签名证书设置为无。 我已经用以下命令一一创建了 Xcarchive。

xcodebuild -scheme xxxx -workspace xxx.xcworkspace -configuration Release clean archive -archivePath "/Users/exxx/Desktop/PROD/xxx.xcarchive" CODE_SIGN_ENTITLEMENTS=/Users/exxx/Desktop/PROD/Cert/entitlements.plist CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

& 不通过 CODE_SIGN_ENTITLEMENTS

xcodebuild -scheme xxxx -workspace xxx.xcworkspace -configuration Release clean archive -archivePath "/Users/exxx/Desktop/PROD/xxx.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO

当我使用 Organizer 上传该存档时,在最终检查时它会显示授权摘要,其中始终缺少“aps-environemt” key 。我附上了屏幕截图以供引用。两个版本都有同样的问题。

我也尝试过将相同的导出存档导出到 codesign 并获得权利,但这也不起作用。 (使用以下命令)

codesign --entitlements  /Users/xxx/Desktop/PROD/Cert/xxx.entitlements -f -s xxx /Users/xxx/Desktop/PROD/xxx.xcarchive

当我的上传完成后收到来自苹果的邮件,

您的应用似乎注册了 Apple 推送通知服务,但应用签名的权利不包括“aps-environment”权利...

enter image description here

最佳答案

要将 APS 权利添加到您的 xcarchive,您应该使用具有 aps-environment 的 entitlements.plistsign 您的 .app 文件 键(和其他需要的键)例如:

entitlements.plist

<?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>aps-environment</key>
    <string>development</string>
</dict>
</plist>

接下来使用权利签署嵌入式框架和您的应用文件:

$ codesign -f -s "<codesiging identity>" -v /foo.xcarchive/Products/Application/foo.app/Frameworks/*
$ codesign -f -s "<codesiging identity>" --entitlements /pathToEntitlements/entitlements.plist /foo.xcarchive/Products/Application/foo.app

要获得可用的代码签名身份,请运行下一个命令:

security find-identity -vp codesigning

关于ios - 缺少未签名的 xcarchive aps 环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65678931/

相关文章:

ios - iPad 在 Instruments 目标选择中变灰

ios - 适用于 iOS 的 Google Firebase 推送通知在生产环境中不起作用

ios - APNs/火力地堡 : when is it needed?

在iOS 13上构建时,UITableViewCell selectedBackgroundView的颜色不可见

Xcode 11 - 模拟器不会响应

uiscrollview - 如何使用自动布局修复 Xcode 11(iOS 12、iOS 13)中的 "Scrollable Content Size Ambiguity"

ios - 使用嵌入在动态框架中的第三方框架

ios - 在 iOS 7 中显示键盘时出现问题 'Resizing' UITextView

ios - ios 10 中的 AVCapturePhotoSettings 错误?

ios - 推送通知、php 错误和警告