iOS offline shader compiler missing

I have been using the offline shader compiler for mac successfully, by first running


xcrun -sdk macosx -find metal


which returns the path to the shader compiler executable:


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/metal


Running this executable with -std=osx-metal2.0 successfully compiles the shader.


Repeating the same procedure for ios with


xcrun -sdk iphoneos -find metal


returns the exact same executable path. Running the executable with -std=ios-metal2.0

(or any other of the ios strings) produces the error message


error: cannot execute tool '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios/bin/metal'


The ios subdirectory is missing on my mac. I use OS X 13.6 and XCode 10.1. What is happening here and

where can I get all missing files to compile shaders for ios offline?

Replies

Answering my own post here. I found that running


xcrun -sdk iphoneos metal <arguments>


works. In order to find out why the approach in the orginal post doesn't work I ran the command again with the -l option, which prints out the actual command executed:


env SDKROOT=<path to sdk> <path to metal executable> <arguments>


Thus running the metal executable directly only works if the SDKROOT env variable is set correctly. The default SDK path can be found by running xcrun with the --show-sdk-path parameter.