2

It's easy to enable Metal API validation when running my app via Edit Scheme -> Run -> Options -> Metal API Validation: Xcode logging: "Metal API Validation Enabled"

But what about for testing? There is no such setting in Edit Scheme -> Test, and validation appears to be off when I run tests.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Taylor
  • 5,871
  • 2
  • 30
  • 64

1 Answers1

6

Set the METAL_DEVICE_WRAPPER_TYPE environment variable to 1 in Edit Scheme -> Test -> Arguments.

Taylor
  • 5,871
  • 2
  • 30
  • 64
  • 3
    Hi Taylor, do you know how to disable "Metal API Validation Enabled" or remove this message this appears in my debug console. – Sanjeevcn Mar 09 '20 at 11:03
  • @Sanjeevcn To disable Metal API Validation, click on your scheme at the top of the window, go to Edit Scheme > Diagnostics > Metal API Validation. There will be a checkbox that you can untick. – McKinley Jan 16 '22 at 05:05