Oh, wow, that’s tricky. In the <Virtualization/VZVirtualMachine.h>
header the save and restore methods are wrapped in:
#if defined(__arm64__)
…
#endif
That means they’re not available on Intel. I’m still using an Intel machine, so I see this all the time. You must be using an Apple silicon machine, so you only see it when you create a release build, which builds the Intel architecture.
How to proceed depends on your deployment goal:
-
If your app only works on Apple silicon, remove the Intel architecture from your release build.
-
If virtualisation is only part of your app’s feature set, and so you want to support the rest of your app on Intel, wrap your virtualisation functionality in a conditional:
#if arch(arm64)
…
#endif
This is the Swift equivalent to the Objective-C in the earlier snippet.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"