Search Unity

Accessing Android SDK root location

Discussion in 'Android' started by mayankgrover, Mar 4, 2014.

  1. mayankgrover

    mayankgrover

    Joined:
    Nov 1, 2012
    Posts:
    2
    Hi,

    I would like to access the android sdk root location in my project that is set by the user in their Unity -> Preferences -> External Preferences -> Android SDK Location. Is there a way to access this in C# ? (I do not want to go with assuming that the user has setup the env variable pointing to sdk root location)

    I did find that it was accessible through EditorPrefs.GetString("AndroidSdkRoot") but that API does not exist anymore.

    Unity version 4.3.2f1

    Thanks
     
  2. mayankgrover

    mayankgrover

    Joined:
    Nov 1, 2012
    Posts:
    2
    nvm, the example I mentioned works. I was including the wrong namespace, silly me.

    UnityEditor.EditorPrefs.GetString("AndroidSdkRoot")
     
    andrew-lukasik likes this.