Delphi and Xcode 8.3.x deployment solution

Since Apple updated Xcode to version 8.3.x, iOS IPA deployment is broken with Delphi up to 10.2 (Tokyo). There is an official workaround, which basically instructs to download Xcode 8.2 and use that for now:

http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page#iOS_10

Unfortunately though, Apple started sending out notifications, that it won’t accept any builds created with Xcode versions older than 8.3.2 anymore. This is what I’ve received from Apple a few days ago:

„Dear developer,
We have discovered one or more issues with your recent delivery for „AppEvents“. Your delivery was successful, but you may wish to correct the following issues in your next delivery:
Deprecated Xcode Build – Due to resolved app archives issues, we will be deprecating Xcode 8.3 on May 10, 2017, at which time app archives built with 8.3 will no longer be accepted by the App Store. Download Xcode 8.3.2 or newer, rebuild your app and resubmit.
After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
Regards,
The App Store team“

The problem with Delphi and Xcode 8.3 is basically a tool, that Apple decided to remove from its tool chain, but which Delphi still depends on. So the solution is to copy that missing tool „PackageApp“ from 8.2 to 8.3. Below are the steps that made my Delphi 10.2 (Tokyo) iOS deployment fully working again:

  1. Install current Xcode from Appstore into your applications folder – currently 8.3.2
  2. Download Xcode 8.2.1 from
    https://developer.apple.com/download/more/
  3. Unzip Xcode_8.2.1.xip to a separate folder (e.g. /tmp/Xcode)
  4. Make a backup copy of your current Xcode version:
    cp -R /Applications/Xcode.app /tmp/Xcode.8.3.app (might take a minute or two)
  5. Copy the following file from 8.2.1 to your current Xcode app:
    sudo cp /tmp/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/

8 Comments

  • Dave Nottage

    22. Mai 2017 at 23:24

    Notwithstanding your solution for using Xcode 8.3.2, I beg to differ on what Apple’s message actually means. It reads:

    „..we will be deprecating Xcode 8.3 on May 10, 2017, at which time app archives built with 8.3 will no longer be accepted by the App Store.“

    Note that it specifically refers to 8.3, not „older than 8.3.2“, because the problem was specifically with 8.3. There are indeed people still successfully submitting apps using Xcode 8.2

  • Hans Jakobsen

    9. Juni 2017 at 12:30

    It works, thank you 😀

    • Olaf Monien

      26. Juli 2017 at 20:08

      my pleasure 🙂

  • John

    22. Juni 2017 at 20:46

    After trying the above patch, I now get this series of errors and the app will not package.
    Xcode 8.3.3
    Delphi 10.2 Toyko

    any ideas? Thanks.

    [PAClient Error] Error: E0776 Unable to execute ‚“/usr/bin/xcrun“ -sdk iphoneos PackageApplication -v
    „/Users/spcrdev/PAServer/scratch-dir/JohnB-DevMacEthernet/sk8attend.app“ -o „/Users/spcrdev/PAServer/scratch-dir/JohnB-DevMacEthernet/sk8attend.ipa“ -sign „iPhone Distribution: Servant PC Resources Inc. (A8KQ897YCU)“ –embed „/Users/spcrdev/Library/MobileDevice/Provisioning Profiles/436c130f-399b-457a-8338-5f61898bc1a9.mobileprovision“‚ (Error 1)
    [PAClient Error] Error: E0776 error: /usr/bin/codesign –force –preserve-metadata=identifier,entitlements,resource-rules –sign iPhone Distribution: Servant PC Resources Inc. (A8KQ897YCU) –resource-rules=/var/folders/mm/_jx36tv93dx3dk1gndt51f340000gp/T/vn35sFJDDB/Payload/sk8attend.app/ResourceRules.plist –entitlements /var/folders/mm/_jx36tv93dx3dk1gndt51f340000gp/T/vn35sFJDDB/entitlements_plistjrtDFBbL /var/folders/mm/_jx36tv93dx3dk1gndt51f340000gp/T/vn35sFJDDB/Payload/sk8attend.app failed with error 1. Output: Warning: usage of –preserve-metadata with option „resource-rules“ (deprecated in Mac OS X >= 10.10)!
    [PAClient Error] Error: E0776 Warning: –resource-rules has been deprecated in Mac OS X >= 10.10!
    [PAClient Error] Error: E0776 /var/folders/mm/_jx36tv93dx3dk1gndt51f340000gp/T/vn35sFJDDB/Payload/sk8attend.app: replacing existing signature
    [PAClient Error] Error: E0776 /var/folders/mm/_jx36tv93dx3dk1gndt51f340000gp/T/vn35sFJDDB/Payload/sk8attend.app: resource fork, Finder information, or similar detritus not allowed

    • Olaf Monien

      26. Juli 2017 at 20:12

      Do you have Xcode’s command line tools installed?
      xcode-select –install

  • Francis

    7. Juli 2017 at 13:29

    Hi All experts,
    I am newcomer to use xcode in Mac OS; now I encounter a problem that xcode 9 Beta 2 or xcode 8.3.3.xip cannot be opened correctly and installed with default archive application bundled in Mac OS 10.12.
    Could anyone can help me please?

Delphi and Xcode 8.3.x deployment solution

Since Apple updated Xcode to version 8.3.x, iOS IPA deployment is broken with Delphi up to 10.2 (Tokyo). There is an official workaround, which basically instructs to download Xcode 8.2 and use that for now:

http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page#iOS_10

Unfortunately though, Apple started sending out notifications, that it won’t accept any builds created with Xcode versions older than 8.3.2 anymore. This is what I’ve received from Apple a few days ago:

„Dear developer,
We have discovered one or more issues with your recent delivery for „AppEvents“. Your delivery was successful, but you may wish to correct the following issues in your next delivery:
Deprecated Xcode Build – Due to resolved app archives issues, we will be deprecating Xcode 8.3 on May 10, 2017, at which time app archives built with 8.3 will no longer be accepted by the App Store. Download Xcode 8.3.2 or newer, rebuild your app and resubmit.
After you’ve corrected the issues, you can use Xcode or Application Loader to upload a new binary to iTunes Connect.
Regards,
The App Store team“

The problem with Delphi and Xcode 8.3 is basically a tool, that Apple decided to remove from its tool chain, but which Delphi still depends on. So the solution is to copy that missing tool „PackageApp“ from 8.2 to 8.3. Below are the steps that made my Delphi 10.2 (Tokyo) iOS deployment fully working again:

  1. Install current Xcode from Appstore into your applications folder – currently 8.3.2
  2. Download Xcode 8.2.1 from
    https://developer.apple.com/download/more/
  3. Unzip Xcode_8.2.1.xip to a separate folder (e.g. /tmp/Xcode)
  4. Make a backup copy of your current Xcode version:
    cp -R /Applications/Xcode.app /tmp/Xcode.8.3.app (might take a minute or two)
  5. Copy the following file from 8.2.1 to your current Xcode app:
    sudo cp /tmp/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/

2 Comments

  • German Pablo gentile

    17. Juli 2017 at 17:56

    Still cannot solve this problem, get this error:

    iOS output: err=Unable to install package. (e8000067)

    Im a little desesperate at this point. Idera dont care about this, i must apply external suggestions, no official answer from idera.

    Please let me know if it works with latest XCODE versions or dont.

    • Olaf Monien

      26. Juli 2017 at 20:05

      There are actually various reasons fro this error. It basically means that one of the many jobs in the tool chain failed. One rare but subtle problem is if you more than one Apple developer account. This may lead to duplicate names of your provisioning profiles.
      To find the actual error run the last command manually (the one that fails, and which is visible in Delphi’s output pane) this typically shows more detailed error messages.