Hey Gabriel,

> On Aug 23, 2021, at 1:48 PM, Gabriel Zachmann via Cocoa-dev 
> <cocoa-dev@lists.apple.com> wrote:
> 
> I have a screensaver that compiles and runs fine when I use the active scheme 
> "My Mac".
> However, when I switch to "Any Mac (Apple Silicon, Intel)", I get the error 
> message 
>   "A build only device cannot be used to run this target"
> in Xcode immediately.
> 
> Maybe, the following info is related to this error message, maybe not:
> The scheme is a bit uncommon, perhaps, because it has a Pre-action in the Run 
> tab
> (which copies the .saver bundle into ~/Library/Screen Savers), 
> and in the Run section the Executable is set to "System Preferences.app".
> (It works fine under the "My Mac" scheme.)

That pop-up actually has two halves: first, a scheme, and second, a run 
destination.

“Any Mac” and “My Mac” are run destinations, not schemes.  But, as you’ve seen, 
“Any Mac” is a special “build-only” run destination that only supports 
building, not running.

You should be able to pair your scheme with either of those run destinations.  
(If not, check the ARCHS (“Architectures”) setting of your targets.  Normally, 
it should be set to $(ARCHS_STANDARD) (“Standard Architectures (Apple Silicon, 
Intel)”) — which is the SDK default anyway.)

If you wish to build your scheme with the “My Mac” run destination and make 
sure you’re building for both architectures, check out the ONLY_ACTIVE_ARCH 
(“Build Active Architecture Only”) build setting.  When YES, Xcode will build 
only for the architecture of your run destination; when NO, it’ll build for all 
valid architectures.

Normally, ONLY_ACTIVE_ARCH is set to YES for debug builds and NO for release 
builds.  The idea is to avoid slowing down your edit-build-debug cycle by 
building code you’re not going to run.  However, some people like to change 
that.

HTH,

Matt
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to