Hello,
We have been scrambling with this issue for a while now, and now that we have found the solution, we wanted to share it, as some of you will most probably encounter it next time you submit an app to the App Store (TestFlight or Final application).
In the end, the reason for receiving an unfriendly email after a successful submission in Xcode, is due to the fact that Apple recently changed their security policy, and that the .codea directory in the project now needs to be signed.
So, here is how you do it :
copy paste the following code in codesign-codea.sh (for example)
put the file in your project root directory
chmod +x codesign-codea.sh in a terminal to be able to execute it
#!/bin/sh
if [ -z "${CODE_SIGN_IDENTITY}" ] ; then
echo "CODE_SIGN_IDENTITY is not set"
if [ "${CONFIGURATION}" = "Release" ] ; then
exit 1
else
# Code-signing not needed for non-release builds.
exit 0
fi
fi
ITEMS=""
if [ -d "${SRCROOT}" ] ; then
DIRS=$(find "${SRCROOT}" -depth -type d -name "*.codea")
RESULT=$?
if [[ $RESULT != 0 ]] ; then
exit 1
fi
ITEMS="${DIRS}"
fi
# Prefer the expanded name, if available.
CODE_SIGN_IDENTITY_FOR_ITEMS="${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then
# Fall back to old behavior.
CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}"
fi
echo "Identity:"
echo "${CODE_SIGN_IDENTITY_FOR_ITEMS}"
# Change the Internal Field Separator (IFS) so that spaces in paths will not cause problems below.
SAVEIFS=$IFS
IFS=$(echo -en "\
\\b")
# Loop through all items.
for ITEM in $ITEMS;
do
echo "Signing '${ITEM}'"
codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" "${ITEM}"
RESULT=$?
if [[ $RESULT != 0 ]] ; then
IFS=$SAVEIFS
exit 1
fi
done
# Restore $IFS.
IFS=$SAVEIFS
Then, in your project, go to the Build Phases tab and click on the + to add a phase
Select “New Run Script Phase”
In the space reserved for it, type
${SRCROOT}/codesign-codea.sh
Clean and Build your project, a new directory “_CodeSignature” should be created in the .codea directory, this will allow the application to be submitted successfully.
Hope this helps !
Maybe @Simeon can integrate this script in the export feature in a future version.
BTW, this script was inspired by and a combination of several scripts and ideas I found on stack overflow, I do not want to pretend I discovered America or India, I just want to post the solution I found to help
Cheers,
Xavier.