Submit an OSX App with helper App in its bundle

自作多情 提交于 2019-12-04 07:48:46

问题


I'm really going mad with this problem! I have an app that contains a simple Helper app which manages the login item for the Main app.

When I try to submit the app I get errors related to the provisioning profile and the entitlements. I'm sure that the problem is related with the Helper app because before than I added it the submission worked with no problem.

At the moment the helper app is code signed and is sandboxed as the main app.

The errors are :

  • Invalid provisioning profile. The provisioning profile included in the bundle is invalid

  • Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the one that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile 'com.apple.application-identifier' in 'myapp.app/Contents/Library/LoginItems/helper.app'

  • Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the one that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile 'com.apple.application-identifier' in 'myapp.app/Contents/MacOS/myapp'


回答1:


For anyone else coming across this problem, you don't have to codesign the helper app a second time, just remove the "embedded.provisionprofile" from the helper app in the xarchive and you can submit no problem.




回答2:


The only solution that seems to solve this problem was codesign and sandboxing the helper app from Xcode and then:


Re-Codesign the Helper app from terminal

codesign -f -s "3rd Party mac Developer Application:" -i "com.bundle.YOUR.HELPER" --entitlements path/to/helper/entitlements YEOR-HELPER.app



Remove provisioning profile from Helper app, adding a "Run script" into the "Build Phases"

rm"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Library/LoginItems/YOUR-HELPER.app/Contents/embedded.provisionprofile"

With this solution we've correctly submitted our App.




回答3:


I had the 3rd error when I accidentally included some 3rd-party .a files in my target. (They're needed for non-App Store distribution but I'd forgotten to exclude them for the App Store build). The error wasn't too helpful in tracking this down!




回答4:


I was finally able to resolve this problem by 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


来源:https://stackoverflow.com/questions/11230168/submit-an-osx-app-with-helper-app-in-its-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!