Xcode12

 admin
Xcode12

Check out more information on Devmountain:discuss various features a functionality of the Xcode Simulator. Things like the new toolbar. Support for iOS 14 and Xcode 12 to accompany Apple’s Xcode 12 GM release was just announced! Now, build your Xamarin.iOS (and Xamarin.Forms for iOS) apps with Xcode 12 GM and submit your iOS 14, tvOS 14 or watchOS 7 apps to the Apple App Store.

Since June, 22nd 2020, Apple released Xcode 12, that introduced an internal change to Xcode, breaking arm64e compilation for tweak developers. This is due to the update of clang/LLVM (AFAIK) in Xcode 12.

Details of the problem

More specifically:

  • compiling code for arm64e with Xcode 11 Toolchain will allow this code to run only on iOS 13 and lowerfor all versions!.
  • compiling code for arm64e with Xcode 12 Toolchain will allow this code to run only for iOS 14 (and up).
Xcode 12.2 beta download

No error is produced during compilation. arm64 slices are not concerned and will always work.

Why does this annoy us and not others?

Apps and other 'classic' stuff are not impacted by this change, because they only need to be compiled for arm64, which is not impacted by this change. Only IPAs, debs, and 'system' stuff that need to be compiled for arm64e are impacted.

Workarounds

Methods to allow arm64e compiling. Tested on macOS Catalina & Big Sur.

Method 1: bypass (deprecated and not recommended)

This method consists on swapping the Xcode 12 toolchain with the one of Xcode 11:

  1. Execute the script below (please take a look at it and change variables as needed) if your setup is similar to mine.
  2. If you have Xcode 11 installed too, go to Xcode 12 › Xcode › Preferences › Locations › Command Line Tools and change to Xcode 11.x in the dropdown menu.
Xcode12

Method 2: forced compilation (do that!)

Xcode12

Although it's not recommended by theos maintainers, it works well and is less constraining that switching between Xcode installations. To proceed, add this in your tweak's Makefile:

Xcode12

Xcode 12.4

OR
compile your tweak like this:

Method 3: Xcode 11 + 12

Painful and only for Intel Macs, but the best solution according to @kabiroberai. Depending on your configuration/available storage, you can:

  • Stay with Xcode 11 and don't update
  • Use Xcode 11 as main but sideload Xcode 12 for other purposes (thanks to this awesome tool)
  • Use Xcode 12 as main but switch installations each time you want to compile for arm64e too (similar to above): sudo xcode-select -s /path/to/Xcode_11.app, make package, then again sudo xcode-select -s /path/to/Xcode_12.app

Xcode 12 Release

Double-sliced packages (useless, ignore it)

Waiting for the fix within theos to support both arm64e slices in only one package, there is a 'bypass' available to create this type of package. To do so, simply use opa334's script to compile your code with the patched lipo binary by Matchstic (called plipo).

Sources

  • This Twitter thread, devs feedbacks and my observations (and my pain).
  • This update from @opa334, thanks to @sbingner.

Xcode 12 Vim

Disclaimer: I may be not perfectly exact on the terms I use, correct me if I'm wrong!

Xcode 12 Release Date

Update 1: clarified a bit, added double slices part, fixed typo
Update 2: fixed link
Update 3: rollback to previous system, bye 'double slices'!
Update 4: mentioned 'the best' solution, improved some points