GPU capture from a unit test

Is there a way to do a GPU capture from a unit test? This would be useful for our debugging of compute kernels (specifically, how they modify textures). Also useful for profiling and optimization.


I tried using MTLCaptureManager but it didn't seem to do anything.


thanks!