[HOW-TO] Set up & use Android Debug Bridge (ADB) on OS X

Discussion in 'Alternatives to iOS and iOS Devices' started by Jessica Lares, Jul 2, 2013.

  1. Jessica Lares macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #1
    Most of the newer Android devices now require the use of MTP to transfer stuff to and from the device and the Android File Transfer program is a PITA to get working for some. So I'll show you how I handle it.

    Setup

    First off, you'll need to enable the Development options on your phone:

    Gingerbread (Android 2.3):

    Settings> Applications> Development> USB Debugging

    Ice Cream Sandwich (Android 4.0):

    Settings> Developer Options> USB Debugging

    Jelly Bean (Android 4.1):

    Settings> Developer Options> USB Debugging

    Jelly Bean (Android 4.2):

    Scroll to the bottom and find your About Phone page. Scroll down to the Build Number and hit it 7 times and it should tell you that Development is now enabled.

    On the Kindle Fire HD, it's under Security> Enable ADB

    Next, you'll want to download the Android SDK tools here:

    http://developer.android.com/sdk/index.html

    Scroll down and click USE AN EXISTING IDE and download the package. Unzip it, and then drag the folder into your Documents. Rename it to "Android SDK".

    To finish, you'll need to add it to your path:

    Open the Terminal app (it's under Utilities in your Application folder if you don't know) and type:

    Code:
    open -a TextEdit .bash_profile
    (If it's not there, "touch .bash_profile" will create it)

    This will open up TextEdit and the .bash_profile file. You'll want to type:

    Code:
    export PATH="/Users/YOURUSERNAME/Documents/Android SDK/platform-tools/":$PATH
    Change YOURUSERNAME to whatever your home folder is.

    After you've quit and restarted Terminal, try and see if it works by simply typing:

    Code:
    adb
    It should come up with a bunch of commands and such and NOT "-bash: adb: command not found".

    Usage

    You'll get used to the commands very quickly. :D I usually just drag the file in so I don't have to change directories beforehand.

    To install an app, it's just install:

    Code:
    adb install yourapp.apk
    To push a file or folder, use push:

    Code:
    adb push whateveryouwant /sdcard/
    If you want to pull photos or backups, you'd use pull:

    Code:
    adb pull /sdcard/Pictures/
    And this is how to do a screenshot:

    Code:
    adb shell screencap -p /sdcard/screen.png
    adb pull /sdcard/screen.png
    adb shell rm /sdcard/screen.png
    It takes it, pulls it to your home folder, and then deletes it from your SD card.

    Common Structure

    And finally, here are the common media folders:

    Code:
    /sdcard/Music/
    /sdcard/Podcasts/
    /sdcard/Ringtones/
    /sdcard/Alarms/
    /sdcard/Notifications/
    /sdcard/Pictures/
    /sdcard/Movies/
    /sdcard/Download/
    If you're paranoid about someone being able to plug your device in and mess with the settings, well don't, because it was easy enough for anyone to do it anyway. :D But you can easily turn it on and off if needed.
     
  2. MRU macrumors demi-god

    MRU

    Joined:
    Aug 23, 2005
    Location:
    Other
    #2
    Thanks Jessica as alway. :) your tips and guides should be stickied.
     
  3. Explicitic macrumors 6502

    Joined:
    Oct 26, 2012
    Location:
    Undecided
    #3
    I prefer simply copying adb (and fastboot) to the bin folder ._.
    Nice guide, anyway.
     
  4. Jessica Lares thread starter macrumors G3

    Jessica Lares

    Joined:
    Oct 31, 2009
    Location:
    Near Dallas, Texas, USA
    #4
    You have to be an administrator though I would think?
     
  5. SlCKB0Y macrumors 68040

    SlCKB0Y

    Joined:
    Feb 25, 2012
    Location:
    Sydney, Australia
  6. shreyas2415 macrumors newbie

    shreyas2415

    Joined:
    Feb 1, 2016
    #6
    Worked like a Cake Walk!! Thanks so much for your instructions
     

Share This Page