System.Diagnostics.Process.Start() does not work at macOS for 2020.3

Hi!

I need System.Diagnostics.Process.Start() for our in-editor tools, but running this script on macOS fails with the error:

Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/Kernel32
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.dylib
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.so
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32.bundle
Fallback handler could not load library /Applications/Unity/Hub/Editor/2020.3.43f1/Unity.app/Contents/Frameworks/Mono/lib/libKernel32
Win32Exception: ApplicationName='aarch64-linux-android-objcopy', CommandLine='', CurrentDirectory='/Applications/Unity/Hub/Editor/2020.3.43f1/PlaybackEngines/AndroidPlayer/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin', Native error= mono-io-layer-error (2)
    at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <1e13855442cf491a8b11d7de866cc016>:0
    at System.Diagnostics.Process.Start () [0x0003a] in <1e13855442cf491a8b11d7de866cc016>:0
    at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()

Looks like Process.StartWithCreateProcess() is implemented as P/Invoke into kernel32.dll but I cannot confirm this. I see people are using Process.Start() on Macs.

Any ideas?

Try the simplest version: Process.Start some bash script that does nothing more than return an exit code or log something.

It‘s probably an issue of the command, path or arguments not well formed or simply a permission issue - remember that on osx you have to flag a bash script as executable with chmod +x otherwise it cannot run.