具有多个目标的项目的代码签名问题 [英] Code Signing issue for Project with Multiple Targets

查看:97
本文介绍了具有多个目标的项目的代码签名问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取未出现在Dock中的应用程序,以使其具有登录时启动的选项.这很棘手,涉及创建另一个辅助应用程序,您将该应用程序添加为启动项.此助手应用程序仅负责启动主应用程序然后退出.

I'm trying to get my application, which does not appear in the Dock, to have an option to launch at login. This is tricky, and involves creating a second, helper application which you add as a startup item. This helper app is only responsible for launching the main app and then exiting.

我已按照说明此处此处,它就像一个魅力一样-问题当然是代码签名.我有两个目标;辅助应用程序目标将在编译时复制到主捆绑软件的Contents/Library/LoginItems子目录中.每个捆绑软件都有自己的捆绑软件标识符和部署配置文件,但是当我验证应用商店的存档时,出现以下错误:

I've followed the instructions here and here and it works like a charm - the problem is, of course, code signing. I have two targets; the helper app target is copied to the Contents/Library/LoginItems subdirectory of the main bundle at compile time. Each bundle has its own bundle identifier and own deployment provisioning profile, but when I validate my archive for the app store, I get the following error:

Invalid provisioning profile. The provisioning profile included in the bundle BUNDLE NAME [BUNDLE NAME.app] is invalid. For more information, visit the Mac OS Developer Portal.

如果我从主要目标中删除了助手包,那没有问题.似乎另一个配置文件的存在正在引起错误.

If I remove the helper bundle from my main target, there's no problem. It looks like the presence of another provisioning profile is setting off the error.

如何包含两个签名的捆绑包并通过验证?

How can I include two signed bundles and pass the validation?

推荐答案

我终于可以通过在同事的计算机上使用codesign解决我的问题(我的钥匙串一定有问题)并删除了通过添加以下运行脚本从帮助程序应用程序中获取文件:

I was finally able to resolve this problem by using codesign on a coworker's computer (there must have been something wrong with my Keychain) and deleting the embedded.provisionprofile file from the helper app by adding the following run script:

if [ -f "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile" ];
then
    rm "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/embedded.provisionprofile"
    echo "Removed embedded provisioning profile."
else
    echo "No profile found"
fi

这篇关于具有多个目标的项目的代码签名问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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