Search Unity

Android Studio on Mac OS - Accessing SDK through "Android Studio.app"

Discussion in 'Android' started by alexandre-fiset, Jun 18, 2013.

  1. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Hi,

    I recently installed Android Studio and wanted to test some accelerometer-related stuff using my old Nexus S.

    The problem is that Unity doesn't find the SDK and if I manually try to assign the directory, it is not accessible. In fact, the sdk folder is *inside* the Android Studio.app and can't be accessed through Mac OS file manager (greyed out as seen on the image below).

    $Capture d’écran 2013-06-18 à 17.28.24.png

    $Capture d’écran 2013-06-18 à 17.29.28.png

    Is there any way to fix that or do I have to install the SDK twice on my mac?

    **EDIT 1**
    It doesn't work on Windows either. Unity doesn't recognize the sdk folder.
     
    Last edited: Jun 18, 2013
  2. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    26
  3. HashCode

    HashCode

    Joined:
    Aug 21, 2013
    Posts:
    1
    You can use the sdk inside Android Studio by create a simple link to the sdk in Android studio and setup Unity3d use sdk through the simple link:eek:
     
  4. Marcelo Colombo

    Marcelo Colombo

    Joined:
    Apr 18, 2014
    Posts:
    4
    Open the Terminal program, this is the only command line you will need

    sudo ln -s /Applications/Android\ Studio.app/sdk /Applications/AndroidSDK

    This will create a symbolic link in Applications called “AndroidSDK” (you can change this to be whatever you want) that actually links to the SDK that’s within the Android Studio application.

    Now in Unity in the Preferences under the main Unity menu you will find the option to browse to the Android SDK in External tools. Browse to the newly created link and select it as your Android SDK and now you’re ready to publish to Android from the Mac using only the new Android Studio IDE.

    Source: http://darkmobius.com/2014/01/17/unity-and-android-studio-on-a-mac/
     
    mitchell-massey likes this.
  5. banzai777

    banzai777

    Joined:
    Apr 27, 2013
    Posts:
    17
    None of the sol
    This symbolic links are not selectable in the Unity browse dialog. Is there a fix for this?
     
  6. nygren

    nygren

    Joined:
    Feb 13, 2014
    Posts:
    33
    You could try to use the "Go to folder" functionality in the browse dialog that Unity opens. Default shortcut is Command+Shift+G.

    There you can enter the path to the SDK, which at time of writing is /Users/<user>/Library/Android/sdk/ Of course, replace <user> with your OS X username.

    The "Go to folder" dialog has rudimentary Tab-completion which could help you getting the path written correctly. You can also drag a file or folder into the "Go to folder" dialog from a Finder window to get the path.
     
    Last edited: Jan 30, 2015
  7. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    In Windows the default is to install the SDK elsewhere from the folder structure containing Android Studio because it is updated so often. I would remove your Android Studio installation and configure the SDK to be in something like <Home>/Documents/Design/Android/SDK

    or something destination like that.
     
  8. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    @nygren 's solution is a good one. The <cmd> + <shift> + g does bring up the "Go to folder"... all you need to add here is ~Library and then continue surfing, if you don't want to type in the entire path. The tilde (~) means "user root".

     
    jurisdoctor likes this.
  9. firez2469

    firez2469

    Joined:
    Mar 10, 2018
    Posts:
    5
    My android studios files don't have SDK folder