Unity.exe -batchmode -nographics -logFile - -executeMethod UnityEditor.SyncVS.SyncSolution -projectPath . -quit
可以通过调用unity内置的函数来实现。
方法二
public static void createSLN()
{
UnityEditor.EditorApplication.ExecuteMenuItem("Assets/Open C# Project");
}
"C:\Program Files\Unity\Editor\Unity.exe" -batchmode -logFile -quite -projectPath <Project/Path>" -executeMethod "Game.createSLN"