Thursday, March 24, 2016

Submitting to App Store and Mac App Store from beta version OSX box

You probably met already the following error during submitting your product to the (Mac) App Store:
Don't submit apps built with beta software including beta OS X builds
The reason is that Xcode adds the OS version to the application Info.plist file by default and if you are using a pre-release, beta version of OSX you will get the above error during the app validation process in iTunes connect.
It looks like something like this in the Info.plist
<key>BuildMachineOSBuild</key>
<string>14D87h</string>
Quick and dirty solution can be the next one,  add a new 'Run Script' build step at the end of your Build Phases of the given build target, like

if [ "${CONFIGURATION_TYPE}" == "Release" ]; then
    // "15E65" <- 10.11.4 Any other older is fine if not beta, pre-release, etc. like "14C2043" 10.10.2
    defaults write "${CONFIGURATION_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/Info.plist" BuildMachineOSBuild "15E65"
fi

This will replace the BuildMachineOSBuild key value to the currently latest official OSX version number of 10.11.4 and lies to iTunes connect your app built on that OS.

p.s: No, this is not recommended all the times, but can be a quick solution if you have not got a backup OSX developer machine with an official (not beta, pre release, etc.) OS version and you have to deploy urgently.

No comments: