Looking at your test project, it’s clear that your goal is to generate code on the fly. That’s not supported on iOS [1]. All the executable code must come from an appropriate signed Mach-O image that’s either part of your app or part of the system.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] There’s one exception to this, namely web browsers. Safari and third-party browsers can use JIT, but with some significant restrictions. See Protecting code compiled just in time.
Note that this requires authorisation to use the com.apple.developer.cs.allow-jit
entitlement. This is a managed entitlement, that is, Apple must approve your use of it. AFAIK that approval is only granted to browser developers.
Oh, don’t confused com.apple.developer.cs.allow-jit
with com.apple.security.cs.allow-jit
. The latter is for the macOS hardened runtime, and any developer can use it on macOS.