原理是使用官方提供的命令行 重点参数 -projectPath -buildTarget
https://docs.unity3d.com/Manual/CommandLineArguments.html
mac 系统命令参考,其他系统可参考上面的网址
/Applications/Unity/Unity.app/Contents/MacOS/Unity -projectPath 项目路径 -buildTarget standalone
其中standalone为目标平台,具体可参考上面网址中的 -buildTarget
PS:用这个命令Unity崩溃了好多次,解决方法就是多试几次,还是不行就换个平台试几秒然后立马切回来