From Cocoa, how can I do the following two things:
-
Determine the architectures available within a binary? The equivalent of 'file foo.dylib', but by calling an API rather than launching a task to run that command.
-
Launch a process using a specific architecture in a universal binary, say an executable with both arm64 and x86_64, and I want to launch the x86_64 arch on an M1 Mac. The equivalent of 'arch -arch x86_64 foo', but perhaps by specifying an option to NSTask rather than launching an 'arch' task.