0

我正在从命令行构建一个 iOS 应用程序,然后使用 xcrun 对移动设备进行签名/嵌入。

当我从 GUI 运行时,我看到了预期的内容,并且能够收集推送通知的设备令牌: Payload/appname.app/embedded.mobileprovision 中的嵌入式配置文件显示以下信息:

<key>aps-environment</key>
<string>production</string>

当我在应用程序有效负载上运行 codesign -d --entitlements 时,我看到以下内容:

<key>aps-environment</key>
<string>production</string>

当我从命令行运行时,我在嵌入式配置中看到了相同的内容,但是 codesign --entitlement 的输出不再显示 aps-environment。我用于命令行构建的命令如下:

/usr/bin/xcodebuild -configuration Distribution clean build
/usr/bin/xcrun -sdk iphoneos PackageApplication "path-to-the.app" -o "file.ipa" --sign "iPhone Distribution: My Name" --embed "path-to-the.mobileprovision"

我从设备看到的错误是:

No valid 'aps-environment' entitlement string found for application 'appname': (null). Notifications will not be delivered.

与 GUI 相比,我在命令行中做错了什么?

4

0 回答 0