Hi, I’ve got a problem using unity3d command line for building an android apk…
I’m using Jenkins to manage the building and to see the unity3d output.
My problem is that Unity doesn’t find my android-sdk and the building seems go in an endless loop with a “detecting android-sdk…” output.
My unity preferences are set up well, because if I build with Unity3d opened everything build and runs well… Is there a way to specify the android sdk directory in the command line or via code?
I also looked for the unity path in the windows register and the androidsdk path is correct… I’m running windows 7 and I have another jenkins istance installed on a Mac with another copy of Unity that works fine… The only difference from the two command lines are the “-nographics” added in the windows version… because of that I have no idea of what could be wrong, someone has an hint?
What’s the command line for build apk ? I didn’t found it here : Unity - Manual: Command-line arguments?
I am look for the command line for build ios to.
I’m experiencing the same issue on MacOS 10.8 + Unity 4.1.5 + TeamCity. My command line is:
/Applications/Unity/Unity.app/Contents/MacOS/Unity -batchmode -quit -projectPath %teamcity.build.checkoutDir% -executeMethod ProjectBuilder.DeployAndroid
If I build from inside the Editor everything works fine, but calling it from TeamCity (through command line) Unity asks me for the location for the android sdk, rendering the automate build useless as I have to be checking into it from time to time.
Hey everybody, just in case someone runs into this the future, I found the solution to this problem here:
I created a new class with this exact code
using UnityEditor;
public static class AndroidSDKFolder
{
public static string Path
{
get { return EditorPrefs.GetString("AndroidSdkRoot"); }
set { EditorPrefs.SetString("AndroidSdkRoot", value); }
}
}
I set the property when the automated build is triggered right before Unity starts it’s build player process. Hope this helps!