Setting home directory android

How To Set Android SDK Path In Windows And Mac

After you installed android studio, you still need to configure some android SDK environment variables then you can use it easily. This article will tell you how to correctly configure Android SDK environment variables such as ANDROID_HOME, PATH on Windows and macOS.

1. Configure Android SDK Variable In Windows.

1.1 Get Android SDK Install Directory Path.

Before you can configure it, you should first get the android SDK install directory follow below steps.

  1. Open android studio, click File —> Settings menu item in the top men bar.
  2. Expand Appearance & Behavior —>System Settings —>Android SDK menu item on the left side of the popup window. Then you can find the Android SDK Location directory path on the right side ( in this example, the Android SDK location path is C:\Users\Jerry\AppData\Local\Android\Sdk ), remember it.

1.2 Set %ANDROID_HOME% and %Path% System Environment Variable.

  1. Right-click the computer icon in Windows file explorer left side, click Properties menu item in the popup menu list. This will open the windows system configuration window.
  2. Click the Advanced system settings link on left panel, it will popup the System Properties window, click the Environment Variables button to open Environment Variables window.
  3. Click the New… button to add a new system variable, input ANDROID_HOME as the variable name, and input the Android SDK location directory path ( such as C:\Users\Administrator\AppData\Local\Android\Sdk ) as the variable value.
  4. Select variable Path and click Edit button and add ;%ANDROID_HOME%\tools;%ANDROID_HOME%\tools\bin;%ANDROID_HOME%\platform-tools at the end of its value. Please note the ; must be English character otherwise it will not take effect .
  5. Click OK to close the system environment variables settings window, open a dos window, type command adb in it. If you see output like below that means the android SDK path variable has been configured successfully.

2. Configure Android SDK Variable In macOS.

  1. Open Android Studio on macOS, then click Android Studio —> Preferences menu item at the left top toolbar.
  2. Input search keyword sdk in the search box of the popup Preferences dialog window left side.
  3. It will focus on the Android SDK menu item on the left side, and you can get the Android SDK Location directory path value on the right side Android SDK Location text box.
  4. Generally, the Android SDK is installed in the /Users/user-name/Library/Android/sdk folder on macOS.
  5. If you can not find the above folder in macOS finder or terminal, this is because the Library folder is a hidden folder by default, you should make the hidden folder visible by executing the command $ defaults write com. apple . finder AppleShowAllFiles TRUE in a macOS terminal window ( please read article How To Show Hidden Files In Mac OS Finder And Select Hidden Files In Html Upload File Form ).
  6. You can also see the hidden Library folder by opening a macOS Finder window, then click Go —> Go to Folder… menu item, and input

/Library in the popup dialog input text box, then click Go button.

  • This is also another method to show the hidden Library folder, open a macOS Finder window, click Go —> Home menu item. Right-click the home folder, then click the Show View Options menu item in the popup menu list. Check the Show Library Folder checkbox.
  • Use nano to create or edit user bash profile in user home directory.
  • Add ANDROID_HOME and PATH environment variable in user bash profile.
  • Make the added system environment take effect.
  • Now open a terminal and run adb, you should also see something output like in windows.
  • Источник

    Change the home directory default location in Android Studio

    I figured out how to change the default save location/workspace by creating a new project and picking a different directory.
    Before, it was C:\Users\Name\AndroidStudioProjects but now I changed the default save location to C:\Name\Android\AndroidStudioProjects

    However, in Android Studio when I go to File > Open it opens to a default directory of C:\Users\Name\ where it used to be. The sdk is here too so maybe that’s why. This is known as the Home Directory in Android Studio, but how do I change this path?

    2 Answers 2

    When we want to open a existing project or anything in Android Studio, this window pops up. The four buttons for path variables on top left of the window is used to help navigating to most frequently used directories as Home Directory, Desktop Directory, Project Directory and Module Directory. The first two are inherited from system variables and the last two are retrieved from current project settings (that’s why they’re inactive when no project is opened).

    What Jason need as I do either is just a project repository. I use D:\Workspace\AndroidStudio\ as my project repository storing all my project files. So it’s rather inconvenient to navigate to my projects, I have to left click at least 5 times to my repository.

    Android Studio doesn’t allow users to specify a repository directory and even if it supports user-defined path variables, I can’t figure out how to use it in this window. I guess we have to add a button to quickly navigate to repo directory and that’s probably too trivial for IDE developers.

    Finally, I discovered the Recent Files button which can largely help me navigating although not perfectly. I suggest you use this sub-optimal solution instead if you’re suffering from mouse-clicking pain like me.

    Источник

    Failed to find ‘ANDROID_HOME’ environment variable

    I am trying to build an ionic-android project and i have android sdk installed.

    The name of my project is myApp.I have successfully added android platform to myApp. But when i tries to build the project

    see the ANDROID_HOME and PATH variable

    I have seen almost the same kind of questions on stack overflow, but none works for me. Is there anything wrong with my android-sdk configuration? How can i build this project?

    16 Answers 16

    You may want to confirm that your development environment has been set correctly.

    Set up the Android development environment

    Before you can build Android applications, you must install the Android SDK. Installing the Android SDK also installs the AVD Manager, a graphical user interface for creating and managing Android Virtual Devices (AVDs).

    From the Android web site, download the correct version of the Android SDK for your operating system.

    Unzip the archive to a location of your choosing. For example, on Linux or Mac, you can place it in the root of your user directory. See the Android Developers web site for additional installation details.

    Configure the ANDROID_HOME environment variable based on the location of the Android SDK. Additionally, consider adding ANDROID_HOME/tools , and ANDROID_HOME/platform-tools to your PATH.

    Mac OS X

    Linux

    Windows

    The Android SDK download does not include specific Android platforms. To run the code in this guide, you need to download and install the latest SDK platform. You do this by using the Android SDK and AVD Manager that you installed in the previous section.

    Open the Android SDK Manager window:

    Note: If this command does not open the Android SDK Manager, then your path is not configured correctly.

    Select the Tools checkbox.

    Select the checkbox for the latest Android SDK.

    From the Extras folder, select the checkbox for the Android Support Library.

    Click the Install packages. button to complete the download and installation.

    Note: You may want to install all the available updates, but be aware it will take longer, as each API level is a large download.

    Источник

    How to set ANDROID_HOME path in ubuntu?

    How to set ANDROID_HOME path in ubuntu?

    Please provide the steps.

    20 Answers 20

    In the console just type these :

    If you want to make it permanent just add those lines in the

    /.bashrc in your terminal. The folder you are in has no importance

    I would like to share an answer that also demonstrates approach using the Android SDK provided by the Ubuntu repository:

    Install Android SDK

    Export environmental variables

    Assuming you have the sdk extracted at

    Add the above lines to the file

    /.bashrc (located at home/username/.bashrc ) to make it permanent for the current user. Run source

    /.bashrc to apply the changes or restart your terminal.

    Run the above lines on a terminal window to make it available for the session.

    To test if you have set it up correctly,

    Run the below commands on a terminal window

    echo $ANDROID_HOME

    which android

    Run android on a terminal window, If it opens up Android SDK Manager, you are good to go.

    /.profile (or .bashrc) if you don’t want to logout.. then try running ‘sdkmanager —licenses’. Then try compiling.

    better way is to reuse ANDROID_HOME variable in path variable. if your ANDROID_HOME variable changes you just have to make change at one place.

    Initially go to your home and press Ctrl + H it will show you hidden files now look for .bashrc file, open it with any text editor then place below lines at the end of file.

    Please change /home/varun/Android/Sdk path to your SDK path. Do the same for tools and platform-tools.

    After this save .bashrc file and close it.

    Now you are ready to use ADB commands on terminal.

    Add the following to your

    /.bashrc file. Log-out and log-in. I have my sdk in $HOME/Documents/Android/sdk you have to replace it with where you keep your sdk folder

    /.bashrc can substitute for logging out then logging in.

    first open the .bashrc file by gedit

    # Added ANDROID_HOME variable. export ANDROID_HOME=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/platform-tools

    save the file and reopen the terminal

    it will show the path like /home/pathTo/Android/Sdk

    Applies to Ubuntu and Linux Mint

    Restart the terminal and doing: echo $ HOME or $ PATH, you can know these variables.

    Download the Android SDK to the machine. (Suppose that the location is /home/zelong/Android/Sdk) (home/username/Android/Sdk)

    Add these lines to the file

    /.bashrc (located at home/username/.bashrc)

    This will make it permanent for the current user because every time the machine boots, it will run this script and set the enviroment path.

    After making this change, remember to save it.

    Then run source

    /.bashrc to apply the changes or restart your terminal.

    Test if it works:

    android command line locates under tools

    adb command line locates under platform-tools

    This is what work for me, Assuming you have the sdk extracted at

    Add the above lines to the file

    /.bashrc (located at home/username/.bashrc ) to make it permanent for the current user. Run source

    /.bashrc to apply the changes or restart your terminal. (or) Run the above lines on a terminal window to make it available for the session. To test if you have set it up correctly, Run the below commands on a terminal window

    You can run this too

    Run android on a terminal, If it opens up Android SDK Manager, you are good to go.

    Источник

    How do I set ANDROID_SDK_HOME environment variable?

    I’m working with Eclipse on Windows 7, x64. I’m getting an error when running ADT bundle of android development:

    Error: Error parsing the AVDs
    Unable to get the Android SDK home directory.
    Make sure the environment variable ANDROID_SDK_HOME is set up.

    I know what the issue is. Is it because it is linked to a wrong directory C:users.

    How do I set this environment variable android_sdk_home to the proper directory?

    13 Answers 13

    ANDROID_HOME

    Deprecated (in Android Studio), use ANDROID_SDK_ROOT instead.

    ANDROID_SDK_ROOT

    Installation directory of Android SDK package.

    Example: C:\AndroidSDK or /usr/local/android-sdk/

    ANDROID_NDK_ROOT

    Installation directory of Android NDK package. (WITHOUT ANY SPACE)

    Example: C:\AndroidNDK or /usr/local/android-ndk/

    ANDROID_SDK_HOME

    Location of SDK related data/user files.

    Example: C:\Users\ \.android\ or

    ANDROID_EMULATOR_HOME

    Location of emulator-specific data files.

    Example: C:\Users\ \.android\ or

    ANDROID_AVD_HOME

    Location of AVD-specific data files.

    Example: C:\Users\ \.android\avd\ or

    JDK_HOME and JAVA_HOME

    Installation directory of JDK (aka Java SDK) package.

    Note: This is used to run Android Studio(and other Java-based applications). Actually when you run Android Studio, it checks for JDK_HOME then JAVA_HOME environment variables to use.

    /.android/avd directory. Any idea what could be the issue? I ended up using a symlink from

    /.android to my desired directory.

    If you face the same error, here are the step by step instructions:

    1. Open control panel
    2. Then go to System
    3. Then go to Change Environment Variables of the User
    4. Then click create a new environment variables
    5. Create a new variable named ANDROID_SDK_HOME
    6. Set its value to your Android directory, like C:/users/ /.android

    /.android/ on Linux, which corresponds to %USERPROFILE%\.android on Windows. The fact is that, you don’t need to specify the .android subfolder. On Windows, you just set ANDROID_SDK_HOME to whatever folder it resides in. So, in the OP’s case, it would be set to C:\Users\ or %UserProfile% and for others, wherever you like. The only caveat is that the (parent) folder must exist.

    Copy your SDK path and assign it to the environment variable ANDROID_SDK_ROOT

    Refer pic below:

    This worked for me:

    1. Open control panel
    2. click System
    3. Then go to Change Environment Variables
    4. Then click create a new environment variables
    5. Create a new variable named ANDROID_HOME path C:\Android\sdk

    open your adt and open preferences, then modify directory with your sdk dir, it may help you follow the pic link indication

    Installing the Android SDK is also necessary. The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.

    Cordova requires the ANDROID_HOME environment variable to be set. This should point to the [ANDROID_SDK_DIR]\android-sdk directory (for example c:\android\android-sdk).

    Next, update your PATH to include the tools/ and platform-tools/ folder in that folder. So, using ANDROID_HOME , you would add both %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools .

    Although the above answers mostly get them right, there is one slight issue with them all.. Follow these steps and you are good to go

    1. Right click on This PC -> Properties
    2. On the left pane select «Advanced System Settings»
    3. On the new window select -> Advanced tab
    4. Click on the «Environment Variables» button
    5. On the first top section click on the «New» button

    set variable name -> ANDROID_HOME

    set variable value -> the custom location of the Android SDK

    1. Now click on the newly created variable name and in the box below select «Path» and click on the Edit button
    2. Now click on New and paste the location of the «platform-tools»
    3. Again click on New and paste the location of the «tools» You can find the locations of the above platform-tools and tools — they are generally inside the Android SDK folder
    4. MOST IMPORTANT OF ALL.

    save all those by clicking ok If you are using the terminal(cmd) close it and open it again

    Источник

    Читайте также:  Код меню батареи андроид
    Оцените статью