Terminal Emulator vs. adb


Last Updated:

  1. cmotion

    cmotion Well-Known Member This Topic's Starter

    Joined:
    Jan 24, 2010
    Messages:
    140
    Likes Received:
    18
    So I hear a lot of talk about "pushing" things with adb shell, and from what I've read I believe this requires a PC? If I have a Mac, and want to perform some of these actions, can they be done with the terminal emulator, and if so, do I just copy exactly the directions for adb or do I have to change them slightly? And yes, that was quite the run-on sentence, my English teachers would probably cringe...
     

    Advertisement
  2. scary alien

    scary alien not really so scary Moderator

    Joined:
    Mar 5, 2010
    Messages:
    21,649
    Likes Received:
    21,987
    cmotion,

    The Android SDK is also available for the Mac (and Linux). In fact, from what folks have posted, hooking your phone up to your Mac doesn't result in the USB connectivity problems that a lot of folks have on their Windows-based PCs.

    You can't use adb from the Terminal Emulator since its a client-server pair: the adb.exe on your PC (or Mac) communicates with the adbd daemon on the Android-side (your phone). So, you can't really do the phone-to-phone thing via adb.

    Instead, you would just use the Unix shell commands from the Terminal Emulator to copy things to and from your /sdcard (if that's where you were going). For example, let's assume you've started-up the Android Terminal Emulator and you want to copy a ROM from your /sdcard/download directory to the top-level of the /sdcard, you would type:

    cp -p /sdcard/download/your-rom-name.zip /sdcard/your-rom-name.zip

    - or a slightly less verbose version to accomplish the same thing:

    cp -p /sdcard/download/your-rom-name.zip /sdcard/.

    -- or , you could move it instead of copying it --

    mv -i /sdcard/download/your-rom-name.zip /sdcard/your-rom-name.zip

    -- and the less-verbose version (you can see where this is going) --

    mv -i /sdcard/download/your-rom-name.zip /sdcard/.

    The world is your oyster with Unix and a shell prompt ;).

    If you really just need to transfer files from your Mac, you can just install the SDK (Android SDK | Android Developers) and use adb push and pull like you've read. Or, you can just hook your phone up as a disk drive and transfer files with your favorite file explorer.

    Cheers!
     
    cmotion likes this.
  3. cmotion

    cmotion Well-Known Member This Topic's Starter

    Joined:
    Jan 24, 2010
    Messages:
    140
    Likes Received:
    18
    Surprise, surprise... Scary Alien with more useful, helpful advice! Thank you very much for that info-- I can't remember where I heard talk about only being able to use a PC, but apparently it wasn't in regards to this. That stuff is good to know, I was actually just trying to push a custom bootanimation into the /data/local folder, but then remembered that EStrongs has an "experimental" root explorer function (as I am currently too cheap to purchase Root Explorer) which worked perfectly fine. What, would you say, is the main thing one would use the Terminal Emulator for?
     
  4. scary alien

    scary alien not really so scary Moderator

    Joined:
    Mar 5, 2010
    Messages:
    21,649
    Likes Received:
    21,987
    Well, I'm a Unix geek now (since '94 anyway :p--lots of other stuff before and after then :eek: [mostly Tandem computers--those were awesome to work with]) and I'll pop into the Android Terminal Emulator to poke-around since you can't do everything with a file explorer (like running commands, grep searches, file searching) or is just much simpler directly from the shell prompt.
     
  5. doogald

    doogald Guides Guide

    Joined:
    Jan 7, 2010
    Messages:
    6,620
    Likes Received:
    1,896
    One tip for using adb on a Mac is that, unless you put the path to the SDK tools directory into your path - not a trivial thing to do - you must start all commands with the path to the adb command, or, if you are in the current directory of the adb command, start the command period-slash:

    ./adb ...

    (Or, to say this another way, unlike Windows, Unix computers like the Mac will not search the current directory for commands when you enter them in a terminal window.)
     
  6. doogald

    doogald Guides Guide

    Joined:
    Jan 7, 2010
    Messages:
    6,620
    Likes Received:
    1,896
    One tip for using adb on a Mac is that, unless you put the path to the SDK tools directory into your path - not a trivial thing to do - you must start all commands with the path to the adb command, or, if you are in the current directory of the adb command, start the command period-slash:

    ./adb ...

    (Or, to say this another way, unlike Windows, Unix computers like the Mac will not search the current directory for commands when you enter them in a terminal window.)
     

Share This Page

Loading...