using jenkins auto build android ,but Android SDK Location is missing.

hi all. when I was update to unity5.1 has this problem.

Unity → Preferences → Android SDK Location . set android SDK

I am using jenkins to call unity auto build android apk . but Android SDK Location is missing. I need set android path again.

Preferences → External Tools → Android SDK Location

How can script set it path?

You should be able to set it via:

EditorPrefs.SetString("AndroidSdkRoot", Newpath);

thank you ~ My Jenkins run is OK~~ but I think It 's a bug for unity5
this is my code~

        EditorPrefs.SetString("AndroidSdkRoot","/Volumes/Mac-Tools/android-sdk-macosx");
        if (string.IsNullOrEmpty (BuildPipeline.BuildPlayer (GetBuildScenes (), args [0], BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer))) {
            myencryptDll (args [0]);
        }

I find reason:
In the Unity, call EditorPrefs.SetString(“AndroidSdkRoot”,value) change regedit
HKEY_CURRNET_USER/Software/Unity Technologies/[UnityEDITOR 4.x]/ AndroidSdkRoot_h2651068356

In the Jenkins, call Unity3D Plugin run Unity.exe set EditorPrefs.SetString(“AndroidSdkRoot”,value)change regedit
HKEYS_USER/.DEFAULT/Software/Unity Technologies/[UnityEDITOR 4.x]/ AndroidSdkRoot_h2651068356

So, Unity Run and Jenkins Run , regedit path is different

I thinks Jenkins is third party, so is HKEY_USERS