- Home /
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.
I changed the functions and class to public. Still not working :(
using UnityEngine;
using UnityEditor;
public class TestScript {
public static void Build()
{
Debug.Log ("Build A Platform");
}
}
Answer by Bunny83 · Mar 06, 2017 at 08:38 PM
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.
Thanks! I actually realized the problem is with the Jenkins Unity3d plugin I'm using. Thanks again!
Your answer
Follow this Question
Related Questions
Getting the current BuildOptions 1 Answer
Is it possible to prevent AssertionComponent from being stripped out of non-dev builds? 1 Answer
Batch File and Script to Make Multiple Builds 1 Answer
How to create a BuildOptions mask in the Editor Window? 2 Answers
Should the username/password for unity account be hidden in batchmode build logs? 0 Answers