Adb android studio mac os

Как настроить Android ADB/Fastboot на Mac OS X простым способом

Вот как вы можете быстро и легко настроить Android ADB и Fastboot на Mac OS X.

Настройка ADB (Android Debug Bridge) или Fastboot на любой платформе может оказаться очень сложной задачей, поскольку пользователю требуется выполнить несколько шагов, прежде чем он/она сможет отметить все это в своем контрольном списке. На Mac, однако, вы можете легко настроить ADB и Fastboot за несколько простых шагов, и самое приятное: любой может сделать это практически без знаний о настройке инструментов для разработчиков.

Все готово? Давай начнем!

Как настроить Android ADB/Fastboot на Mac OS X

Прежде чем двигаться дальше, убедитесь, что у вас стабильное интернет-соединение, поскольку это является строгим требованием для установки ADB и Fastboot.

Важно для пользователей OS X El Capitan

Приведенный ниже метод не работает на El Capitan, если у вас включен Rootless. Перезагрузите Mac, удерживая нажатой комбинацию клавиш Command + R, пока не загрузитесь в Recovery. Сверху вы должны увидеть запись с надписью «Утилиты». Нажмите на него, затем нажмите «Терминал». Введите следующую команду:

Перезагрузите Mac, и вы сможете загрузить и установить ADB и Fastboot, используя метод, описанный ниже.

1. Запустите приложение «Терминал» на вашем Mac. Нажмите комбинацию клавиш Command + пробел, чтобы вызвать поиск Spotlight. Введите в терминале и нажмите, чтобы запустить его.

2. Запустив и запустив приложение «Терминал», скопируйте и вставьте следующую команду без каких-либо изменений самостоятельно:

Источник

Help, adb is not found!

So you’ve downloaded Android Studio and installed the SDK. Eventually you may come across a tutorial telling you to type adb , maybe to enable debug mode in Firebase. That’s when it happens:

If your first instinct is to search for “how to install adb,” you’ll likely end up with some instructions about installing it in via your operating system’s package manager or downloading random zip files from phone customization websites. But this isn’t necessary! adb ships with the Android SDK installed by Android Studio, and with a couple of manual steps you can ensure that you’re always using the same up to date tools that your IDE is!

What’s the deal with adb?

adb stands for the “Android Debug Bridge,” which is a command line utility that is the debug multitool for Android. Typically it’s installed via Android Studio when you install the Android SDK under platform-tools , but it takes some amount of setup for your operating system to know to look there.

First open up Android Studio and navigate to “Tools > SDK Manager” from the menu.

Towards the top of the window, you can see the path where the IDE installed the Android SDK.

Now open up your terminal, type cd and paste in this path. This will work on Windows, MacOS, and Linux, but on Windows you may need to press shift+insert to paste into a terminal:

Next type cd platform-tools :

Then type ls (or dir on Windows). You should see adb or adb.exe depending on your operating system. From here you can type ./adb and see some program output.

You can run adb now, but I’ve never found a tutorial that starts with “copy your SDK path, cd into platform-tools, and type ./ before adb .” To get the experience many Android devs enjoy, you must update your PATH environment variable. This will be different on each operating system, and I’ll list out MacOS and Windows below. On Linux the steps can vary, but the MacOS instructions will work in some cases.

Читайте также:  Google android browser support

MacOS Configuration

MacOS (and Linux) users will typically use zsh or bash for their shell. To temporarily add the platform-tools directory to your PATH , type:

So in my example above, this becomes:

Now, whenever you type adb in this terminal window you can execute adb commands. But how do you get this to stick?

Since Android Studio tends to install the Android SDK in your user directory, you’ll want to edit the PATH for your user. And since it’s a command line utility, you’ll only need to update it for your terminal (as opposed to Mac GUI applications). To do this, you’ll want to edit the .profile file in your home directory (if this doesn’t exist, .bash_rc will achieve a similar result). This file will be hidden by default, so you may not see it Finder. Open this file in your favorite text editor:

and add this to the bottom:

Which, on my machine becomes:

Adding the extra define for ANDROID_SDK_ROOT is unnecessary, but it may help with some more complicated power user tools as well, such as the Cocos 2D command line utility.

With that, open a new terminal window and type adb . If you’ve done everything right, you’ll get a help page listing adb ‘s usage.

Windows Configuration

Windows is slightly different, and I’ll work entirely in Power Shell. Just like before, I can use the SDK manager to find my install location:

Источник

How to Install ADB and Fastboot with Android SDK Tools on macOS / OS X

This is a complete guide on how to install and setup ADB, Fastboot and Android SDK tools on your MacBook, iMac or any macOS / OS X powered computer. We have previously covered several guides on how to install these tools on Windows 7, Windows 8 and even on the new Windows 10, but let’s see how you can use these on your macOS system. ADB and Fastboot are two important tools provided by Google if you want to mess around with your Android devices with custom ROMs, rooting the phone or simply trying to access or sideload / install apps manually using command line.

ADB is widely used for performing actions on your Android phone that are not easily possible directly from your phone. Fastboot allows you to install system packages, entire firmware files or root your phone — provided the Android device in the specific system mode called Bootloader Mode or Fastboot Mode.

Installing ADB and Fastboot on macOS is very similar to how you set it up on Windows. You only need to download the Android SDK tools once and the rest can be set up from within that. Since we are not explaining how to set up Android Studio IDE or just the Android Emulator, our download size will be just around 200MB.

How to Install ADB, Fastboot with Android SDK Tools on macOS

Before we continue, please make sure you OS X / macOS system meets the minimum requirements set by Google for everything to run smoothly without any issues:

  • Mac OS X 10.8.5 or higher
  • 2 GB RAM minimum, 8 GB RAM recommended
  • 500MB of available disk space minimum
  • 1280 x 800 minimum screen resolution

Let’s start with the steps below. Please note, you go through all the steps first before actually performing them on your computer.

Step 1 – Download Android Command Line Tools (android-sdk_r24.4.1-macosx.zip) for Mac.

Step 2 – Open the downloaded ZIP file and extract it anywhere in your computer. We extracted the files on our Desktop.

Step 3 – Open the folder that you just extracted on your desktop and make sure you see files and folders as shown below.

Читайте также:  Модулятор голоса для андроид для звонков

Step 4 – Go to the Tools directory and look for an icon called android.

Step 5 – Double-click the android app. A Terminal window will open, and seconds later, you will see the Android SDK Manager window open up.

NOTE: Make sure you are connected to the Internet. SDK Manager will take a few seconds to load and check all the required packages available by Google.

Step 6 – This is the Android SDK Manager. We will use this to select and download ADB and Fastboot on our Mac.

Step 7 – Several items will already be checked on your Android SDK Manager. Uncheck all the items, except Android SDK Platform-tools – You need this for downloading ADB and Fastboot to your computer.

Step 8 – Now click the Install 1 package button. Another window will pop open. Select your Android SDK Platform-tools package from the left side and check Accept and Accept License options from the right side.

Step 9 – You can now finally hit the Install button. Downloading will only take a few seconds depending on your Internet speed.

Step 10 – Once the download and installation finishes, you will be prompted to a similar screen as show below.

Step 11 – You can now complete close Android SDK Manager and all its other windows along with it.

Step 12 – Go to the android-sdk-macosx directory that you extracted on your Desktop in Step 2. If everything went perfect till now, you should see a new folder in there called platform-tools as seen below.

Step 13 – Open the platform-tools directory. You should be able to see the adb and fastboot apps, along with several other tools in this directory.

This is it. You have successfully installed ADB and Fastboot using Android SDK Manager on your Mac computer. To use any of the above tools, you will have to open a new Terminal window and navigate to this android-sdk-macosx/platform-tools directory in order to start ADB or Fastboot for your Android device.

If the final outcome is not something like shown above in the screenshots, or if you are stuck with any kind of error — pleas drop us a comment below and we will try to find a solution to your problem.

Источник

Настроить adb на Mac OS X

Я потратил некоторое время на то, чтобы определить, как настроить adb на Mac, поэтому я считаю, что писать, как его настроить, может быть полезно для некоторых людей. Adb – это инструмент командной строки для установки и запуска приложений Android на вашем телефоне / эмуляторе

Если вы поместите папку android-sdks в другой каталог, замените путь каталогом. Android-sdks / platform-tools находится в

Примечание: это было первоначально написано в разделе «Установка ADB на MAC OS X», но этот вопрос был закрыт как дубликат этого.

Вариант 1 – Использование Homebrew

Это самый простой способ и обеспечит автоматическое обновление.

Начать использовать adb

Вариант 2 – Вручную (только инструменты платформы)

Это самый простой способ получить ручную установку ADB и Fastboot.

Удалите старую установку (необязательно)

Перейдите на страницу https://developer.android.com/studio/releases/platform-tools.html и нажмите ссылку SDK Platform-Tools for Mac .

Перейдите в папку «Загрузки»

Разархивируйте загруженные инструменты

Переместите их где-нибудь, вы случайно не удалите их

Добавить platform-tools на ваш путь

Обновите свой профиль bash (или перезапустите приложение терминала)

Начать использовать adb

Вариант 3. Если у вас уже установлен Android Studio

Добавить platform-tools на ваш путь

Обновите свой профиль bash (или перезапустите приложение терминала)

Начать использовать adb

Вариант 4 – MacPorts

Установите Android SDK:

Запустите диспетчер SDK:

Снимите все флажки, кроме Android SDK Platform-tools (необязательно)

Установите пакеты, получив лицензии. Закройте диспетчер SDK.

Добавьте platform-tools на свой путь; В MacPorts они находятся в /opt/local/share/java/android-sdk-macosx/platform-tools . Например, для bash:

Обновите свой профиль bash (или перезапустите терминал / оболочку):

Читайте также:  Как заряжать андроид от айфона

Начните использовать adb:

Вариант 5 – Вручную (с SDK-менеджером)

Удалите старую установку (необязательно)

Загрузите Mac SDK Tools с сайта разработчика Android в разделе «Получить только инструменты командной строки» . Обязательно сохраните их в папке «Загрузки».

Перейдите в папку «Загрузки»

Разархивируйте загруженные инструменты

Переместите их где-нибудь, вы случайно не удалите их

Запуск диспетчера SDK

Снимите все флажки, кроме Android SDK Platform-tools (необязательно)

  1. Нажмите « Install Packages , примите лицензии, нажмите « Install . Закройте окно диспетчера SDK.

Добавить platform-tools на ваш путь

Обновите свой профиль bash (или перезапустите приложение терминала)

Начать использовать adb

ПРИМЕЧАНИЕ. Путь для adb изменился с тех пор, как Android Studio 1.0.xx

Для оболочки bash используйте:

Для оболочки tcsh используйте:

Лично я просто источник моего .bashrc в моем .bash_profile:

Поэтому я положил его в свой .bashrc. И я использую Android Studio, так что это был другой путь.

Вам также может потребоваться следующее:

Вот несколько мудрой информации:

Запустите терминал и перейдите в свою домашнюю папку.

Откройте и отредактируйте файл .bash_profile.

Если у вас нет файла .bash_profile на вашем компьютере, то создайте его. Введите команду ниже, чтобы создать новый файл. После создания выполните шаг 2.

Сохранить строку ниже)

Обновите файл, используя команду ниже.

Теперь вы должны увидеть свой путь к Android.

Это работает безупречно ….

В терминале Запустите обе команды рядом друг с другом

Если вы используете Android Studio в MAC OS X, вы можете выполнить следующую команду в своем приложении терминала:

И вы должны показывать список с вашими устройствами Android, подключенными через USB-кабель в вашем MAC, например, примерно так:

cd sdk/platform-tools/ а затем использовать ./adb devices

Подводя итог этому:

Создайте и откройте файл bash_profile

touch .bash_profile
open -e .bash_profile

Добавьте путь к папке инструментов платформы (в Android SDK)

export PATH=»$PATH:/Users/USERNAME/PATH TO ANDROID SDK/platform-tools/

Запустите команду . .bash_profile . .bash_profile для обновления (нет необходимости перезапускать терминал)

Если вы используете ZSH и имеете Android Studio 1.3: 1. Откройте файл .zshrc (находится в вашем домашнем каталоге, файл скрыт, поэтому убедитесь, что вы видите скрытые файлы). 2. Добавьте эту строку в конец: alias adb=»/Users/kamil/Library/Android/sdk/platform-tools/adb» 3. Выход из терминала 4. Откройте терминал и введите в adb devices 5. Если он сработает, он предоставит вам список всех подключенных устройств

В моем случае: я сделал следующее (на mac):

  1. Резервное копирование «.bash_profile» и «.profile»
  2. Очистил все связанные с андроидами пути.
  3. Создал новые пути, но на этот раз я перетащил соответствующие папки: в терминал. Я сделал это для «.bash_profile» и «.profile».
  4. Затем после успешного сохранения файлов каждый. Я перезапустил терминал, чтобы быть уверенным в тех изменениях, которые я сделал.
  5. Затем я продолжил тестирование, если adb сейчас отвечает … путем ввода: (в терминале) устройств adb
  6. Мне все еще не повезло (мои устройства), где не показывалось, но я снова перезапустил adb.
  7. Я продолжал делать «adroid update adb». Это только что убило и перезапустило adb
  8. Я попробовал еще раз, пока устройства не показывались.
  9. Я полностью поддерживал свое устройство Android и возвращал весь телефон обратно к заводским настройкам по умолчанию, перешел на активацию устройства для разработки и разрешил отладку usb в своих настройках> приложениях.

Я снова попробовал команду «adb devices», и все было в порядке, устройство было видно.

Всего наилучшего. Просто не сдавайся. Мне потребовалось много проблем. Все самое удачное.

Это полностью сработало для меня, после некоторого разговора после установки Android Studio:

Убедитесь, что у вас есть файл .bash_profile. Это должно быть в вашем каталоге [username].

В любом каталоге, в котором вы находитесь, введите следующее:

Теперь, как правило, у вас будет этот точный путь, но если нет, то используйте любой путь, который у вас есть папка инструментов платформы

Из каталога, в котором находится ваш .bash_profile, введите следующее:

Теперь введите adb devices . Вы должны увидеть ответ «Список подключенных устройств». Теперь вам не нужно каждый раз обращаться к каталогу инструментов-инструментов, чтобы ввести более загадочную команду, например, ./adb devices .

Источник

Оцените статью