Ideally, there would be complete integration with Xcode
That’d be so cool! Please do file an enhancement request describing your requirements, and then post your bug number, just for the record.
is there a way to build my macOS app locally and then copy it over to
a VM to at least try to run it?
Yeah, I do that all the time. The big variable is the level of integration. At one extreme, there’s no supported way to just choose Build > Run in Xcode and have it run in your VM [1]. At the other extreme, you can scp
your program over to the VM and then run it as the user would. And if you do this a lot, you could spend some time improving the integration. For example:
-
You might use a post-build action to do the scp
.
-
You might install the command-line tools on the VM to allow you to run the program in the debugger.
-
Or Xcode, with a dummy project, so you can debug by choosing Product > Perform Action > Run Without Building.
IMPORTANT If you do use scp
, be wary of the issue described in Updating Mac Software.
The annoying snag that I most commonly hit relates to provisioning profiles. If your product requires a restricted entitlement then you need a profile to authorise that, and that means adding the VM’s provisioning UDID to your profile. With manual code signing that’s easy, but it can be a bit tricky to sort out with automatic code signing.
Now, I generally work on low-level stuff so my programs don’t relying on having an Apple ID available in and of themselves. If, for example, you’re building an app that relies on in-app purchase, that’s going to be a problem.
Oh, and this goes much better if your VM software supports snapshots, so you can test and retest from the same position each time. Such support is common in Intel VM products. For all the latest in the Apple silicon world, watch WWDC 2023 Session 10007 Create seamless experiences with Virtualization.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] I’m talking about using supported techniques on production versions of Xcode. There are various unsupported techniques that can help with this. I also know it’s a commonly requested feature, so it wouldn’t surprised if future versions of Xcode offered improvements in this space.