Меню Рубрики

Mac os android adb

Скачать и установить Fastboot и ADB на Mac

В данной статье рассмотрим как на ваш MacBook или iMac (MacOS), установить утилиты ADB и Fastboot для работы с Android.

Несмотря на то, что операционная система macOS является №2 по распространенности, но вот доступных инструкций как в ней работать с Android очень мало, если быть точнее управление устройством с помощью ADB и прошивка смартфонов и планшетов с помощью Fastboot.

Скачать ADB и Fastboot для macOS

Для того чтобы скачать и установить самую свежую версию утилит ADB и Fastboot для Android, вам необходимо перейти на официальный сайт разработки Android developer.android.com и скачать архив для MACOS.

Подготовка ADB и Fastboot к работе в MacOS

  • После того как архив будет загружен переходим в Finder и извлекаем содержимое, после чего, можете переместить папку platform-tools например в Документы.
  • В Terminal-e вам необходимо перейти в папку platform-tools, где уже находятся ADB и Fastboot. Выполнить это возможно с помощью команды для перемещения cd , но для того чтобы понять в какой именно сейчас вы папке находитесь, используйте команду ls .
  • После того как вы окажитесь в папке platform-tools проверяем работу утилит ADB и Fastboot, для это пишем команды следующим образом ./adb или ./fastboot

Если ниже появился вывод информации по использованию утилит, значит все работает правильно.

Включаем отладку по USB на Android

  • Теперь вам необходимо включить «отладку по USB» на Android и подключить к маку, чтобы проверить окончательно, все ли работает нормально, а также видит adb или fastboot ваше устройство.
  • Если ваш смартфон или планшет Android включен в обычном режиме пишем ADB команду:

Если после List of devices attached появился набор букв и цифр и рядом написано device, значит вы сделали все правильно.

Если устройство в режиме Fastboot, то вводим команду:

Для работы с ADB и Fastboot в MacOS в начале нужно всегда указывать ./ :

./adb devices

./adb reboot

./fastboot erase recovery

Все готово, теперь вы можете использовать ADB и Fastboot также как делали это в Windows.

Более подробно о командах ADB вы можете узнать в статье:

Подробно как прошивать Android устройства с помощью Fastboot:

P.S Если не охота каждый раз писать ./

Откройте Finder и нажмите комбинацию клавиш CMD + Shift + G, появиться окно перейти, вставьте путь /bin и нажмите OK.

Скопируйте файл adb и fastboot в папку bin!

Вот и все! Больше статей и инструкций читайте в разделе Статьи и Хаки Android. Оставайтесь вместе с сайтом Android +1, дальше будет еще интересней!

Источник

Installing ADB on macOS [duplicate]

I had issues finding a good solid tutorial on how to setup ADB for Mac.

How can I add ADB to macOS in such a way that it can be used in the terminal?

UPDATE

For those reading this post. Yes, as the edited response says. I was at the time looking for a tutorial with all steps as a beginner level guide.

Unlike Set up adb on Mac OS X, the intention of this question is to have a tutorial with all of the required installation steps to get ADB on macOS.

/Library/Android/sdk/platform-tools/ stackoverflow.com/a/17901693 – Joseph Hansen Mar 31 ’17 at 20:17

5 Answers 5

Option 1 — Using Homebrew

This is the easiest way and will provide automatic updates.

Option 2 — Manually (just the platform tools)

This is the easiest way to get a manual installation of ADB and Fastboot.

Delete your old installation (optional)

Go to your Downloads folder

Unzip the tools you downloaded

Move them somewhere you won’t accidentally delete them

Add platform-tools to your path

Refresh your bash profile (or restart your terminal app)

Option 3 — Manually (with SDK Manager)

Delete your old installation (optional)

Download the Mac SDK Tools from the Android developer site under «Get just the command line tools». Make sure you save them to your Downloads folder.

Go to your Downloads folder

Unzip the tools you downloaded

Move them somewhere you won’t accidentally delete them

Run the SDK Manager

Uncheck everything but Android SDK Platform-tools (optional)

  1. Click Install Packages , accept licenses, click Install . Close the SDK Manager window.

Add platform-tools to your path

Refresh your bash profile (or restart your terminal app)

/.bash_profile – Edwin Feb 13 ’17 at 15:40

If you’ve already installed Android Studio —

Add the following lines to the end of

/.zshrc (if using Oh My ZSH):

Restart Terminal and you’re good to go. 👍

/.bash_profile and it worked! – Martín De la Fuente Feb 5 ’19 at 13:42

Option 3 — Using MacPorts

Analoguously to the two options (homebrew / manual) posted by @brismuth, here’s the MacPorts way:

Install the Android SDK:

Run the SDK manager:

As @brismuth suggested, uncheck everything but Android SDK Platform-tools (optional)

Install the packages, accepting licenses. Close the SDK Manager.

Add platform-tools to your path; in MacPorts, they’re in /opt/local/share/java/android-sdk-macosx/platform-tools . E.g., for bash:

Refresh your bash profile (or restart your terminal/shell):

Note that if you use Android Studio and download through its SDK Manager, the SDK is downloaded to

/Library/Android/sdk by default, not

I would rather add this as a comment to @brismuth’s excellent answer, but it seems I don’t have enough reputation points yet.

You must download Android SDK from this link.

You can really put it anywhere, but the best place at least for me was right in the YOUR USERNAME folder root.

Then you need to set the path by copying the below text, but edit your username into the path, copy the text into Terminal by hitting command + spacebar type terminal. export PATH = $:/Users/**YOURUSERNAME**/android-sdk/platform-tools/

Verify ADB works by hitting command + spacebar and type terminal, and type ADB.

There you go. You have ADB setup on MAC OS X. It works on latest MAC OS X 10.10.3.

Источник

Set up adb on Mac OS X

I spent quite sometime figuring how to set up adb on Mac, so I figure writing how to set it up might be useful to some people. adb is the command line tool to install and run android apps on your phone/emulator

26 Answers 26

Note: this was originally written on Installing ADB on macOS but that question was closed as a duplicate of this one.

Option 1 — Using Homebrew

This is the easiest way and will provide automatic updates.

Option 2 — Manually (just the platform tools)

This is the easiest way to get a manual installation of ADB and Fastboot.

Delete your old installation (optional)

Go to your Downloads folder

Unzip the tools you downloaded

Move them somewhere you won’t accidentally delete them

Add platform-tools to your path

Refresh your bash profile (or restart your terminal app)

Option 3 — If you already have Android Studio installed

Add platform-tools to your path

Refresh your bash profile (or restart your terminal app)

Option 4 — MacPorts

Install the Android SDK:

Run the SDK manager:

Uncheck everything but Android SDK Platform-tools (optional)

Install the packages, accepting licenses. Close the SDK Manager.

Add platform-tools to your path; in MacPorts, they’re in /opt/local/share/java/android-sdk-macosx/platform-tools . E.g., for bash:

Refresh your bash profile (or restart your terminal/shell):

Option 5 — Manually (with SDK Manager)

Delete your old installation (optional)

Download the Mac SDK Tools from the Android developer site under «Get just the command line tools». Make sure you save them to your Downloads folder.

Go to your Downloads folder

Unzip the tools you downloaded

Move them somewhere you won’t accidentally delete them

Run the SDK Manager

Uncheck everything but Android SDK Platform-tools (optional)

  1. Click Install Packages , accept licenses, click Install . Close the SDK Manager window.

Add platform-tools to your path

Refresh your bash profile (or restart your terminal app)

echo «export PATH=\$PATH:/Users/$/Library/Android/sdk/platform-tools/» >>

If you put the android-sdks folder in other directory, replace the path with the directory android-sdks/platform-tools is in

/.zshrc – Gianfranco P. Sep 5 ’13 at 1:17

/.bash_profile – user1401250 Dec 16 ’14 at 6:50

/.bash_profile . – Nighto Apr 13 ’15 at 1:46

This Works Flawless.

In terminal Run both commands next to each other

NOTE: Path for adb has changed since Android Studio 1.0.xx

For bash shell, use:

For tcsh shell, use:

/.bash_profile – dirkoneill Feb 18 ’15 at 0:51

/Library/Android/sdk/platform-tools – galdin Apr 18 ’16 at 8:02

Only for zsh users in iterm2 in macOS

type the following two commands to add the android sdk and platform-tools to your zsh in iterm2 in macOS

After adding the two command to

/.zshrc you need to source the zsh.

Here is a step wise information :

Start up Terminal and go to your home folder.

Open and edit .bash_profile file

If you don’t have .bash_profile file in your computer path, then create one. Enter below command to create a new file. Once created follow Step-2.

Save the below line)

Refresh the file using below command

You should see your android path set in the output now.

Personally I just source my .bashrc in my .bash_profile:

So I put it in my .bashrc. And I’m using Android Studio, so it was a different path.

You may also want the following:

The simplest way to use adb command on your Mac systems would be to add the path to the platform-tools (where adb lives) into your bash_profile.

Steps to add the adb path: 1. open the bash_profile: This can be done by using the following commands

This opens up the bash_profile in an editor.

Locate the platform_tools, usually they are present at the following location: Users/»user_folder»/Library/Android/sdk/platform_tools

Paste the following command in the bash_profile file which opens up:

Save the file using the command:

Check if the path is saved by typing: echo $PATH : You should be able to find the entire path displayed in the output.

Type adb to see if the configuration worked. If you have any devices connected to the machine or any emulators running on your system they would be displayed when you type adb devices

For Mac users : Step 1: Install the Android Studio

Step2 : Open the terminal and type

Step 3: Type below mentioned command changing the userName:

cd sdk/platform-tools/ and then use ./adb devices instead

if you are using Android Studio in MAC OS X , you could exec the following command in your terminal app:

and you should be showing a list with your android devices connected via USB cable in your MAC, for example something like this:

Create and open the bash_profile file

touch .bash_profile
open -e .bash_profile

Add the path of the platform-tools folder (within the Android SDK)

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

Run the command . .bash_profile to update (no need to restart the terminal)

If you are using ZSH and have Android Studio 1.3: 1. Open .zshrc file (Located in your home directory, file is hidden so make sure you can see hidden files) 2. Add this line at the end: alias adb=»/Users/kamil/Library/Android/sdk/platform-tools/adb» 3. Quit terminal 4. Open terminal and type in adb devices 5. If it worked it will give you list of all connected devices

Mac OS Open Terminal

command + S for save.

If you are setting the path in Catalina use below command one after another in the terminal. It’s working fine for me.

If you using zsh then you need do the add the following to your .zshrc

Steps: Step 1: Open your .zshrc profile

Step 2: Add the following to the file

Step 3: Save the file and close. Step 4: Reload the .zshrc

Step 5: Check the devices connected

Commenting with some updated information from 2018.

Executable Binaries for Platform tools are made available for mac by Android here: https://developer.android.com/studio/releases/platform-tools.html

Download these to your mac. Place them in a directory e.g. I placed in

If you have root access, the easiest way I have found on a mac is to add your directories to the list in /etc/paths . I like this way because after a few additions the $PATH starts to look too messy and hard to read, the /etc/paths has everything in separate line, clean and organized. The downside is that you require root access.

Paste the full path of your platform-tools directory (something like /Users/GodZilla/Software/platform-tools/adb ) at the end of this list and save. Quit and Open terminal again and check if it sees your platform-tools directory.

If you don’t have root access, just add the platform-tools directory to $PATH in your .bash_profile (or .zshenv if you use zsh) as other users have suggested.

This totally worked for me, after dickering around for a while after installing Android Studio:

Make sure you have the .bash_profile file. This should be in your [username] directory.

From whatever directory you are on, type this:

Now, usually you will have this exact path, but if not, then use whatever path you have the platform-tools folder

From the directory where your .bash_profile resides, type this:

Now type adb devices . You should see a «List of devices attached» response. Now you do not have to go to the platform-tools directory each and every time to type in the more cryptic command like, ./adb devices .

In my case, I installed Android studio, and have some apps (rust lang) that changes the

/.profile , and adding adb to

/.bash_profile made the rust un-executable, so I made the changes to the

For macOS Users Updated to MacOs Catalina,

/.bash_profile changed to

So ,to run adb command and all other commands already exported to

/.bash_profile easy walkaround is to export bash_profile to zshrc

1) Navigate to the home directory in finder

2) I used Cmd + Shift + . to show the hidden files in Finder

3) Create .zshrc file if already not exist

4) Add line «source

/.bash_profile» without quotes

5) Save

6) Quit and open terminal

start using adb devices

In my case : I did the following (on a mac) :

  1. backed up the «.bash_profile» and «.profile»
  2. cleared all the android related paths.
  3. created the new paths but this time around, I dragged the respective folders : < /. /sdk, /. /tools, /. /platform-tools >into the terminal. I did this for both «.bash_profile» and «.profile».
  4. Then after successfully saving the files each. I restarted the terminal just to be sure about the modifications I made.
  5. I then went on to test if adb was responding now . by typing : (in terminal) adb devices
  6. I still had no luck (my devices) where not showing, then I restarted the adb, still.
  7. I went on to do «android update adb» . This just killed and restarted the adb
  8. I tried again still the devices wasnt showing.
  9. I totally backed up my android device and resetted the whole phone back to factory default, went over to activate the device for development and allow for usb debugging in its settings > applications.

I tried again with the command «adb devices» and everything was back to normal the device was visible.

All the best. Just dont give up. It took me a lot of troubleshooting. All the best of luck.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Mac os amd для vmware
  • Mac os amd ryzen
  • Mac os amd fx 6300
  • Mac os amd e450
  • Mac os alt tab