I have been using unit tests for iOS apps running on a mac (Designed For iPad destination). The reason is that I need to be able to test Metal code on an Apple Silicon GPU and I can't do that using the Simulator since it's treated as a different GPU.
Since upgrading to Xcode 14.3 that no longer seems possible: It's telling me Unable to initialize test bundle from file ....
The console seems to suggest it's a Sandbox violation. Can anyone from Apple confirm that this is intended? Are there any other ways to unit test iOS code on an Apple Silicon GPU?
Post
Replies
Boosts
Views
Activity
I can't get my stencil buffer to track one state for back and front facing triangles.
Assigning the same descriptor as suggested in the headers does not work:
MTLDepthStencilDescriptor *depthDescriptor = [[MTLDepthStencilDescriptor alloc] init];
[... asigning values to back stencil]
depthDescriptor.backFaceStencil = depthDescriptor.frontFaceStencil;
Creating a stencil yourself and assigning it to both back and front also doesn't work. The backFaceStencil (and front) property is marked as copy so assigning them yourself will inevitably lead to two different objects. So if equality is evaluated purely on the pointer basis of the descriptor - I don't think it's possible to assign the same descriptor here. Is this a bug or am I missing sth?
I want to unit test my iOS app running on my M1 machine. The tests generate snapshots and I'd like to be able to save them on the host machine running the tests but I can't seem to come up with a good way to do it.
I tried saving to the sandbox and using a post action in Xcode to just copy the files from the sandbox to where I need them to be. Unfortunately I have no idea how to reliably retrieve the sandbox url from the iOS app. Instead of the bundle id it seems to use some random UUID for the sandbox identifier (e.g. /Users/[USERNAME]/Library/Containers/D354FAB7-AEA9-4351-BE46-648BF0D13357/Data/Documents/) and I have no idea where that's coming from.
I also can't seem to opt out of the sandbox (which I figured but still).
I can't use NSOpenPanel or any user-driven interaction for getting a system shared folder to save anything to since it's all supposed to be automated.
Any ideas of what I'm missing or what else I might try?
I'm building a caching system for my textures and noticed that setPurgeableState (using MTLPurgeableStateKeepCurrent) always returns MTLPurgeableStateEmpty on the simulator.
Is this a bug?
I'm guessing the texture implementation is different than on the device but the debug strings are more or less the same so I'm wondering if there's a setting the can get the textures on the sim to behave like the textures on the device.
It looks like the inner purgeable state is actually set correctly because it will complain about volatile/empty textures when used in a command buffer.