I discovered a partial resolution that may enable a growth construct completed on the host Mac to run in a visitor VM. It seems that the issue is expounded to the provisioning profile and its registered units.
My Xcode undertaking is setup to do computerized signing. It is a lot less complicated than doing it manually. Nonetheless, the draw back of computerized provisioning is that the generated provisioning profile is simply legitimate for the system you carry out the construct on.
The answer is to show off the “Robotically handle signing” possibility. You then must setup an acceptable provisioning profile that features all the macOS (actual and digital) units that you simply want to run the app on.
For every macOS occasion, run the Settings app (macOS 13 & 14). Go to Normal -> About. Scroll down and click on on “System Report”. Within the generated report search for the worth “Provisioning UDID”. You’ll need that worth for every host/VM. (macOS 12 steps coming as soon as I get a macOS 12 VM operating…)
Add a brand new system for every VM (and host Mac if not already there). Select macOS for the platform. Give it a reputation. Enter the “Provisioning UDID” from the System Report into the “System ID (UUID)” area.
As soon as all the units are setup, go to the Profiles web page and create a provisioning profile with the suitable certificates and bundle id. Choose all the macOS units you want. As soon as created, obtain it to your host Mac.
In your Xcode undertaking it is advisable to import that downloaded profile into the Provisioning Profile entry on your macOS app.
As soon as in place you may construct the app usually. Copy the constructed app to a VM and it ought to now run. Or do an Archive construct and click on on Distribute App. Select Debugging or Customized and full the export. Copy the exported app to the VM. The Customized possibility takes extra steps however provides you extra choices than deciding on Debugging.
Whereas this allows you to construct the app in Xcode on the host Mac and run it in a VM, it nonetheless requires a whole lot of additional work. It’s important to replace the system and provisioning profile anytime you create a brand new VM. It is additional steps to repeat the constructed app to the VM. There’s additionally no option to check any iCloud options (equivalent to CloudKit) or every other options that require the consumer to be logged into an AppleID.