Macos android studio path

Содержание
  1. How To Set Android SDK Path In Windows And Mac
  2. 1. Configure Android SDK Variable In Windows.
  3. 1.1 Get Android SDK Install Directory Path.
  4. 1.2 Set %ANDROID_HOME% and %Path% System Environment Variable.
  5. 2. Configure Android SDK Variable In macOS.
  6. Поиск Android SDK на Mac и добавление в PATH
  7. 1. Как его найти
  8. 2. Как установить его, если нет
  9. 3. Как добавить его в путь
  10. Они живут здесь с установкой по умолчанию:
  11. Вот что вы хотите добавить к своему .bashwhatever
  12. Найдите местоположение Android SDK
  13. Создайте файл .bash_profile для переменных среды
  14. Добавьте переменную PATH в ваш .bash_profile
  15. agrcrobles / android_instructions_29.md
  16. Поиск Android SDK на Mac и добавление в PATH
  17. 6 ответов
  18. Найдите местоположение Android SDK
  19. Создайте файл .bash_profile для переменных среды
  20. Добавьте переменную PATH в свой .bash_profile
  21. Они живут здесь с установкой по умолчанию:
  22. Вот что вы хотите добавить к своему .bashwhatever
  23. How to install Android SDK and setup AVD Emulator without Android Studio
  24. Understanding the Android SDK
  25. Installing the Android SDK
  26. Step 1 — Download the tools package
  27. Step 2— You need Java 8!
  28. Step 3 — Download the essential packages
  29. Step 4 — Set your environmental variables
  30. Step 5 — Download the platform specific packages you want
  31. Step 5 — Create a AVD device
  32. Step 6 — Run the Android Emulator

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.
  • Источник

    Поиск Android SDK на Mac и добавление в PATH

    Я установил Android Studio на своем MacBook Air (OS Version 10.11 El Capitan) и успешно написал небольшое приложение «привет, мир» и установил на устройство (Nexus 7) и работал на AVD. Теперь все, что я хочу сделать, это возможность создать приложение и установить его на устройстве из командной строки, в отличие от Android Studio. Я следую указаниям здесь:

    И соответствующая строка:

    Убедитесь, что каталог / инструменты / каталог Android SDK включен в переменную среды PATH, а затем выполните:

    Проблема в том, что я не могу найти Android SDK на своей машине! Я предполагаю, что это там, потому что иначе программа не будет компилироваться и работать через Android Studio? Может быть, это плохое предположение? Я новичок в Mac (я привык к Windows), поэтому не знаю, как лучше всего искать Android SDK. Поэтому мои вопросы:

    1. Как найти Android SDK на моей машине? Или доказать себе, что его там нет?
    2. Если его нет, как его установить?
    3. Как изменить PATH на Android SDK?

    1. Как его найти

    Откройте Android-студию Goto Android Studio> Preference Search для sdk И что-то похожее на это (это окно, как вы можете видеть) покажет

    Вы можете увидеть его там, большую часть времени он /Users/ /Library/Android/sdk

    2. Как установить его, если нет

    Просто перейдите на страницу Android Standalone sdk и загрузите zip-файл для OSX и извлеките его на путь

    3. Как добавить его в путь

    Откройте приложение терминала и откройте файл пути в nano, набрав

    Введите пароль, перейдите в конец строки и введите путь к каталогу. И вы хотите добавить: например: –

    Сохраните его, нажав Ctrl + X , перезагрузите приложение терминала и посмотрите, работает оно или нет – введите имя любого файла или двоичного файла, которые находятся внутри добавленных вами каталогов, и убедитесь, что он открыт / выполнен

    Если вы не хотите открывать Android Studio только для изменения своего пути …

    Они живут здесь с установкой по умолчанию:

    Вот что вы хотите добавить к своему .bashwhatever

    1. Как найти Android SDK на моей машине? Или доказать себе, что его там нет?

    Когда вы устанавливаете студию Android, она позволяет вам выбрать, хотите ли вы загрузить SDK или нет

    В Android Studio нажмите «Файл >> Настройки».

    Найдите местоположение Android SDK

    Создайте файл .bash_profile для переменных среды

    • Откройте приложение «Терминал»
    • Перейдите в свой домашний каталог через cd
  • Создайте файл с touch .bash_profile
  • Добавьте переменную PATH в ваш .bash_profile

      Откройте файл через open .bash_profile

    Добавьте в файл export PATH=$PATH: [your SDK location] /platform-tools и нажмите ⌘s чтобы сохранить его. По умолчанию это:

    Вернитесь в приложение Terminal и загрузите переменную с помощью source

    Путь по умолчанию для Android SDK – это /Users/ /Library/Android/sdk , вы можете обратиться к этому сообщению .

    Добавьте это в свой .bash_profile, чтобы добавить переменную окружения

    Затем сохраните файл.

    Если Android Studio показывает вам путь /Users/ /Library/Android/sdk но вы не можете найти его в своей папке, просто щелкните правой кнопкой мыши и выберите «Показать параметр просмотра». Там вы сможете выбрать «Показать библиотечную папку»; Выберите его, и вы можете получить доступ к SDK.

    Источник

    agrcrobles / android_instructions_29.md

    A high level overview for what I need to do to get most of an Android environment setup and maintained on OSX higher Catalina and Big Sur with and without Android Studio been installed.

    Considering the SDK is installed under /Users/ /Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.

    Open JDK 14 works fine with gradle 6.x

    Preferred: To install the JDKs 8 ( LTS ) AdoptOpenJDK:

    Alternative: Do not follow this step if followed the step before

    Be sure JAVA_HOME is exported on your bash profile or zshrc depending the shell in usage.

    Without Android Studio

    Or try Command line tools | Android

    Use Command line tools or SDK Manager

    Quick reminder: Have as many build tools as you want, have a single one platform tool with backwards compatibility :=)

    Download and Install Command line tools for mac ( not the android studio unless I need it )

    Use Homebrew to install Android dev tools: Note that Java8 is tricky since licence changed: https://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac

    Install all of the Android SDK components (you will be prompted to agree to license info and then this will take a while to run):

    If you need to have openjdk first in your PATH run: echo ‘export PATH=»/usr/local/opt/openjdk/bin:$PATH»‘ >>

    For compilers to find openjdk you may need to set: export CPPFLAGS=»-I/usr/local/opt/openjdk/include»

    Be sure Intel Hardware Accelerated Execution Manager (HAXM) is properly installed.

    HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor), be sure HAXM is properly installed.

    SDK preferred location

    sdk can be installed on /Library/Android/sdk or /usr/local/ to be sure check it by

    All locations are valid ones from what I am aware of 🙂

    Suggested: You will have to add the ANDROID_HOME to the profile configuration settings either on .zshrc, .bashrc or .bash_profile

    If emulator doesn’t run, i am here to remind you to provide access into System Preferences — Security & Privacy

    Источник

    Поиск Android SDK на Mac и добавление в PATH

    Я установил Android Studio на свой MacBook Air (версия ОС 10.11 El Capitan) и успешно написал небольшое приложение «привет, мир», установил его на устройство (Nexus 7) и запустил на AVD. Все, что я хочу сейчас сделать, это создать приложение и установить его на устройство из командной строки, а не из Android Studio. Я следую инструкциям здесь:

    И соответствующая строка:

    Убедитесь, что каталог Android SDK platform-tools / включен в переменную среды PATH, затем выполните:

    Проблема в том, что я не могу найти Android SDK на своем компьютере! Я предполагаю, что это есть, потому что иначе программа не скомпилировалась бы и не запустилась через Android Studio? Возможно, это плохое предположение? Я новичок в Mac (я привык к Windows), поэтому не знаю, как лучше всего искать Android SDK. Итак, мои вопросы:

    1. Как найти Android SDK на моем компьютере? Или доказать себе, что его там нет?
    2. Если его там нет, как мне его установить?
    3. Как изменить PATH, чтобы включить Android SDK?

    6 ответов

    AndroidStudioFrontScreen Я просто дважды щелкнул установочный файл Android dmg, который я сохранил на жестком диске, и когда появился начальный экран, я перетащил значок Android Studio в папку Applications, теперь я знаю, где он находится . Также при запуске не забудьте щелкнуть правой кнопкой мыши Android Studio, находясь в Dock, и выбрать «Параметры» — & gt; «Держись на скамье подсудимых». Все остальное работает. Доктор Роджер Вебстер

    Путь по умолчанию для Android SDK — /Users/ /Library/Android/sdk , вы можете обратиться к этому сообщению.

    Добавьте это в свой .bash_profile, чтобы добавить переменную среды

    Затем сохраните файл.

    Если Android Studio покажет вам путь /Users/ /Library/Android/sdk но вы не можете найти его в своей папке, просто щелкните правой кнопкой мыши и выберите «Показать вариант просмотра». Там вы сможете выбрать «Показать папку библиотеки»; выберите его, и вы получите доступ к SDK.

    Найдите местоположение Android SDK

    Создайте файл .bash_profile для переменных среды

    • Откройте приложение Терминал
    • Перейдите в свой домашний каталог через cd
  • Создайте файл с помощью touch .bash_profile
  • Добавьте переменную PATH в свой .bash_profile

      Откройте файл через open .bash_profile

    Добавьте export PATH=$PATH: [your SDK location] /platform-tools в файл и нажмите ⌘s , чтобы сохранить его. По умолчанию это:

    Вернитесь в приложение терминала и загрузите переменную с помощью source

    Если вы не хотите открывать Android Studio, просто чтобы изменить свой путь .

    Они живут здесь с установкой по умолчанию:

    Вот что вы хотите добавить к своему .bashwhatever

    1. Как найти Android SDK на моем компьютере? Или доказать себе, что его там нет?

    Когда вы устанавливаете Android Studio, вы можете выбрать, хотите ли вы загружать SDK или нет.

    В Android Studio щелкните Файл & gt; & gt; Настройки

    Источник

    How to install Android SDK and setup AVD Emulator without Android Studio

    If you are trying to develop to Android, you probably will end up installing the Android Studio to get the Android SDK and the AVD Emulator working properly.

    But if you are using another code editor, like Sublime Text or VSCode, installing the Android Studio will just mess up with your setup and consume your precious RAM for no good reason.

    I had a hard time figuring out how to properly do this setup due the lack of documentation about it, so i hope this article helps you. 🙂

    Recommended previous knowledge:

    • SDK (Standard Development Kit); Read about on Wikipedia;
    • AVD (Android Virtual Device); Read about on docs;
    • CLI (Command Line Interface); Read about on Wikipedia;
    • Android API levels; Read about on Vanderbilt University;
    • How to open, navigate and execute files in your OS terminal;
    • Know what are environmental variables;

    Understanding the Android SDK

    Basically, the Android SDK is a bunch of packages necessary to develop for Android.

    These packages stays in subfolders of a folder called “sdk” (or “android-sdk” sometimes). You do not need to know how these packages really work, just what they do.

    The picture below is my Android SDK folder, these are the basic packages you will need in order to get everything working properly.

    Here is a brief explanation of each package:

    • tools: This package is mainly used to manage the other packages and to create AVD’s;
    • emulator: As the name suggest, this is the Android emulator;
    • platform-tools: Some tools to communicate with Android devices when you plug then in your computer;
    • patcher: This package is automatically downloaded by the SDK. I didn’t find what exactly this is for, so just leave it as it is;

    The folders bellow contain sub-folders with the packages for each Android API level.

    • platforms: The platform packages are required to compile your app for the specified API level.
    • system-images: These are the android images used in the emulator.
    • build-tools: These are necessary to build your Android apps

    Installing the Android SDK

    In order to install the SDK we will use the Command Line Tools. These are some quite simple CLI’s used to manage the Android SDK. You can read the documentation here for more details.

    Step 1 — Download the tools package

    First, you need to download the tools package. And with this package you can download the others.

    1. First, go to the Android Studio download page: https://developer.android.com/studio;
    2. Then click in “ Download Options”;
    3. There you will find a table named “ Command line tools only”;
    4. This table contain some zip files. Download the appropriate file for your system ( Windows, Mac or Linux);
    5. Extract this zip and you will get a folder called tools: This is the tools package i explained earlier;

    Create a folder anywhere you prefer to place your SDK. I recommend you to stick with one of these commonly used places:

    • Globally: C:\Android\sdk or C:\android-sdk (this is not default, but i usually set my SDK here on Windows)
    • One user only: C:\Users\ \AppData\Local\Android\sdk
    • Globally: /Library/Android/sdk
    • One user only: /Users/ /Library/Android/sdk

    And move the tools folder to this new sdk folder. Make sure you have admin access to this folder and any sub-folders inside it, or the tools package will fail to download new packages.

    Note: You can also download a pre-build package for your SO (like the one available on Ubuntu repository). But i do not recommend you do to so, because they probably will not be updated and will be harder to manage, since it was automatically installed.

    Step 2— You need Java 8!

    The Android SDK packages require Java 8. If you do not have it, you need to download. If you are using a newer version, you have to downgrade to Java 8 or you will eventually get some errors, because it is not compatible.

    If you do not have the Java 8 SDK, here is how you can install it:

    On Ubuntu run these commands:

    • # sudo apt-get update
    • # sudo apt-get install openjdk-8-jdk

    Sorry for MacOS users, i don’t know how to install it on this OS.

    Step 3 — Download the essential packages

    Now, download the platform-tools and the emulator packages, because they contain some CLI binary files you will need later. I decided to download these packages first in order to set all the necessary environment variables at once and make the rest of the process easier.

    Open a terminal window (you need to use a terminal, not the file explorer), go to your sdk folder and navigate to the /tools/bin directory.

    This folder contain the SDKManager binary: this is a CLI used to list the available packages in the Google’s repository and download, update or remove them from your SDK folder.

    The bellow command will list all packages installed (the first items on the list) and all packages available to download:

    To download the packages, simply copy the package names and pass it as a parameter to the SDKManager CLI using the terminal:

    # ./sdkmanager platform-tools emulator

    If you open your sdk folder you should see these packages folders there.

    Step 4 — Set your environmental variables

    You need to set the below environmental variables containing the path to our SDK, so any running program can find it in your pc:

    ANDROID_SDK_ROOT = Path to your SDK folder

    ANDROID_HOME = The same as ANDROID_SDK_ROOT. This variable is now deprecated, but i recommend setting it because some programs still using it to locate your sdk.

    And add these folders to the PATH variable, making their binary files accessible from everywhere:

    To add the environment variables on WIndows, just follow these steps:

    1. Open the “Control Panel”;
    2. Go to “ System and Security” option in the side menu;
    3. In the window “ System Properties” open the tab “ Advanced”;
    4. Click in the button “ Environment Variables” in the bottom of the page;
    5. In the “ Environment Variables” window you will see two tables: “User Variables” and ” System Variables”.
    6. If you created your sdk folder for one user only, set the variables in the “ User Variables” table;
    7. But, if you create your sdk folder globally, set the variables in the “ System Variables” table instead;

    On Linux, you can set your environment variables in many places. So i choose the ones I found the most appropriate:

      If you created your sdk folder for one user only, set your environment variables in the file

    /.bashrc;

  • If you created your sdk folder globally, set your environment variables in the /etc/environment file. But, be very careful! if you do something wrong with the path variable in this file you will broke your system (yes, i did this). This file is not a script, so you can’t use variables like $HOME, you need to write the full path to the folders. Variables declared in this file just will take effect after you logout .
  • Here is how i set these variables in my Ubuntu, using the file /etc/environment:

    And sorry again, no MacOS instructions for this task.

    You can find more about these environmental variables in the oficial docs here.

    Now your SDK is ready! If you do not need to run the emulator there’s no need to follow the next steps.

    Step 5 — Download the platform specific packages you want

    You need more three packages: The platform, the system-image and the build-tools. You can download these packages for any Android version you prefer. In this article, i will download the packages for the API Level 28.

    Use the “ sdkmanager — list” command to find these packages and download them using the command “ sdkmanager

    Here’s an example:

    Step 5 — Create a AVD device

    Creating a AVD device is a simple task: run the AVDManager command (this is a binary file located in the tools/bin folder of your sdk) with the create avd option, a name for the new AVD and the image you want to use.

    Here is a example:

    # avdmanager create avd — name android28 — package “system-images;android-28;default;x86”

    You will be asked if you want to alter some configurations. You can also modify these configurations later in the file config.ini, located in the avd folder (this folder usually is created in your user folder, under the android directory). The currently active configurations can be find in the file hardware-qemu.ini (this file just will be created after the emulator runs for the first time).

    Step 6 — Run the Android Emulator

    Now you just need to run the emulator command (remember that we added this package to the environmental variables?):

    The emulator take some time to init for the first time. But if you done everything correctly you should see this screen:

    Источник

    Читайте также:  Смарт наручные часы для android
    Оцените статью