Unity -executeMethod Problem (executeMethod method 'Build' in class 'TestScript' could not be found.)

Hi all,

I’m trying to use Unity in batch mode to automate builds using Jenkins CI.

Unity.exe -batchmode -quit -executeMethod TestScript.Build

I get the following errors

17:17:33 executeMethod method 'Build"' in class 'TestScript' could not be found.
17:17:33 Argument was -executeMethod TestScript.Build"
17:17:33  
17:17:33 (Filename: C:\buildslave\unity\build\Runtime/Utilities/Argv.cpp Line: 172)
17:17:33 
17:17:33 
17:17:33 Aborting batchmode due to failure:
17:17:33 executeMethod method 'Build"' in class 'TestScript' could not be found.
17:17:33 Argument was -executeMethod TestScript.Build"

Here is my simple test script that is located in /Assets/Editor/

using UnityEngine;
using UnityEditor;

class TestScript {

	static void Build()
	{
		Debug.Log ("Build A Platform");
	}
}

As per the instructions in this Unity documentation

I’m using Unity 5.609b on Windows.

Has anyone had this work?

Thanks,

Avinash.
PS. I’ve also tried the namespace trick, but that didn’t work for me.

You don’t seem to specify a projectpath:

-projectPath <pathname>

I have used the batchmode once, but that was about 4-5 years ago ^^. As far as i remember it worked just fine. Though i wouldn’t rely on “last open project”. I guess that simply doesn’t work for the batchmode and to be honest wouldn’t make much sense / is dangerous.

If that doesn’t work, try using a more specific classname. “TestScript” could easily conflict with another class.