Ok, so I think I finally figured it out. It seems that the Bot server may have several kinks that Apple should smooth out. I noticed that the distribution IPA created by the Bot server does not have any necessary rights to my application. I searched a bit and found that other people have the same problem. Here is a question that explains the problem very well: IPA created using the Xcode bot does not start for APNS, but it starts if it is created manually through Xcode itself or is created as an archive using Xcode
So, with that in mind, I created and added a file of rights to my project with the minimum rights that I need. I also did the same for the widget that is in my project. Then, during my trigger after integration, I read both rights files and added the necessary rights to it.
# Copy the Entitlements file out of the payload so we can update it APP_ENTITLEMENTS="/tmp/distributionEntitlements.plist" rm -rf ${APP_ENTITLEMENTS} codesign -d --entitlements :${APP_ENTITLEMENTS} "/tmp/Payload/MyAppName.app" WIDGET_ENTITLEMENTS="/tmp/widgetDistributionEntitlements.plist" rm -rf ${WIDGET_ENTITLEMENTS} codesign -d --entitlements :${WIDGET_ENTITLEMENTS} "/tmp/Payload/MyAppName.app/Plugins/${WIDGET_NAME}" # Copy over the latest build the bot just created echo "Copying latest Archive to /tmp/..."; cp -Rp "${XCS_ARCHIVE}" "/tmp/" APP="/tmp/Archive.xcarchive/Products/Applications/MyAppName.app" echo "Updating entitlements file" /usr/libexec/PlistBuddy -c "Add :beta-reports-active bool true" ${APP_ENTITLEMENTS} /usr/libexec/PlistBuddy -c "Add :aps-environment string production" ${APP_ENTITLEMENTS} cat ${APP_ENTITLEMENTS} echo "Updating widget entitlements file" /usr/libexec/PlistBuddy -c "Add :beta-reports-active bool true" ${WIDGET_ENTITLEMENTS} cat ${WIDGET_ENTITLEMENTS}
Then, of course, you have to assign these applications again:
echo "Codesign the widget" cp "${WIDGET_PROVISIONING_PROFILE}" "${APP}/Plugins/${WIDGET_NAME}/embedded.mobileprovision" codesign -fv -s "${FULL_SIGNING_IDENTITY}" "${APP}/Plugins/${WIDGET_NAME}" --entitlements "${WIDGET_ENTITLEMENTS}" --preserve-metadata=resource-rules,requirements echo "Codesign the app" codesign -fv -s "${FULL_SIGNING_IDENTITY}" "${APP}" --entitlements "${APP_ENTITLEMENTS}" --preserve-metadata=resource-rules,requirements echo "Creating .ipa"
After all this, I can upload this IPA to Apple and distribute it using my new beta distribution TestFlight.
jervine10
source share