1. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Using adb and terminal on a mac

Discussion in 'Android Hacks and Help' started by Dandroid247, Dec 29, 2009.

  1. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    Ok, before I say anything I've been reading the other posts about this all morning and most of yesterday. That being said I'm either a complete idiot or am missing something somewhere. Basically I'm really wanting to put these custom boot animations on my phone and do some other things but for some reason I can't seem to make that happen. I was able to root and install 2.1 on it so I'm not understanding why I'm having such issues.

    I'm running a mac and don't know if that makes much of a difference. I've dl the sdk. I've gotten the bootanimation.zip. My debug menus are checked. I open terminal and try to run the commands but it keeps saying "command not found". I try to type the devices command to see if the phone is being registered and get the same response.

    I really want to learn more about how to do things using terminal, adb, and playing around with other aspects of the phone and this site has been loads of help. That along with looking up stuff outside of here.

    Anyway, if somebody could help me out without being too judgemental I would greatly appreciate it a lot. Thanks again everybody :)
  2. mammlouk
    Offline

    mammlouk New Member

    Joined:
    Dec 13, 2009
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    0
    You have to run the commands from the directory they are in and you will need to put a "./" in front of them. The other choice is to add the directory to your terminals PATH variable as instructed here.
  3. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    ok, ill try that other way, I wasn't really sure about that. What does it mean to "cd" something? I noticed in another thread thats how to start. I put that in and it goes from this c-71-207-180-253:~ Parks1$ to thisc-71-207-180-253:tools Parks1$. Does that mean anything in particular?
  4. Berzerker
    Offline

    Berzerker New Member

    Joined:
    Dec 22, 2009
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    0
    Yes, it will display the current directory you're in before the $ sign. ~ means your home directory, or /Macintosh HD/Users/username/

    cd = change directory

    You have to change directory into the directory that adb is stored in, in order for Terminal to find the adb executable. Say you have adb in /Macintosh HD/Users/username/Android/tools/adb

    You need to use "cd /Macintosh\ HD/Users/username/Android/tools/"

    Then you will be able to use adb.
  5. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    alright, as it is the sdk folder is on my desktop. So should I type this ( cd /Users/Username/Desktop\android-sdk-mac_86/tools) instead of what I have been using with all forward slashes or am i misunderstanding? When I use all forward slashes it seems like it changes the directory which is what im assuming it means by saying :tools username$ right? Sorry if I'm not picking up so fast I'm just trying to really get a grasp of this whole concept and what everything means ya know :)
  6. Berzerker
    Offline

    Berzerker New Member

    Joined:
    Dec 22, 2009
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    0
    No, you only need to use \ if you're either on Windows, or there's a space in the folder name, in which the \ needs to go before the space. Otherwise, you use / so it would be "cd /Users/Desktop/android-sdk-mac_86/tools/"
  7. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    ok, got it, i was just confused cause I saw the backslash in between Mac and HD. So I'm doing that right then I'm guessing? The adb file is in the tools folder, so to run that what do I do? This is where i seem to get hung up because it always says directory not found or invalid command.
  8. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    thanx for taking the time to explain all this stuff to me too btw. just in case i forget to say so later :)
  9. Berzerker
    Offline

    Berzerker New Member

    Joined:
    Dec 22, 2009
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    0
    Once you're in the directory "tools" you can run "ls" to list the files in there, if you see adb, you can run ./adb shell or ./adb install, etc. (you need the ./)
  10. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    awesome, i will definitely try that when i get home from work tonight. Is there anything else I should keep an eye out for in particular or other advice? What happens if adb isn't in there or nothing shows up at all?
  11. kaotik0c
    Offline

    kaotik0c New Member

    Joined:
    Dec 23, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    This works for me

    I had to play around with these commands on my Mac as well. The following two commands work for me, assuming the sdk folder is sitting right on the first level of your mac hd and bootanimation.zip is sitting in the tools folder with adb. If not, just alter the paths.

    Keep in mind you can drag and drop into Terminal to make things easy. For instance, the first time I ran this i typed "cd " then dragged the Tools folder over, it inserts the path, especially useful when buried deep (like your desktop).

    cd /android-sdk-mac_86/tools

    /android-sdk-mac_86/tools/adb push bootanimation.zip /data/local

    **also, the big difference I noticed from other posted directions was that in the 2nd command I had to give the path to adb, even though I had changed directory in the previous command. Wouldn't work otherwise. Perhaps a Mac terminal expert can comment on why**
    Last edited: Dec 29, 2009
  12. mammlouk
    Offline

    mammlouk New Member

    Joined:
    Dec 13, 2009
    Messages:
    316
    Likes Received:
    0
    Trophy Points:
    0
    Did you try running it as "./adb push bootanimation.zip /data/local" as has been mentioned previously.
  13. Berzerker
    Offline

    Berzerker New Member

    Joined:
    Dec 22, 2009
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    0
    If adb isn't in there, you're not in the right directory. :)
  14. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    alright, woohoo, it worked. I think it was the whole ./ as opposed to just / that made the difference. I used ls, terminal gave me the file list, put in the push bootanimation command and got a message saying that daemon not running. starting it now, next line says daemon started successfully. so basically do i have to type in ./adb before every command? And just so im understanding, although I'm guessing, when I change directories into the tools folder, does typing ./adb signify to use that exec file to run the command? I mean as opposed to say typing in ./apkbuilder to run a command? I hope that makes sense.
  15. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    oh, and while I'm thinking about it, is there anyway to make sure that the command worked before i actually eject the phone and try it out? I guess what I mean is will terminal give me some sort of confirmation?
  16. Dandroid247
    Offline

    Dandroid247 New Member

    Joined:
    Nov 22, 2009
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    well ill be damned, it worked. hahahaha, you guys have no idea how happy this makes me. not really that I got it done but more so that I understand a little better. This just made my week. Thanks so much you guys for all the help. And I hope that you all won't mind me asking more in the future.
  17. miamidroid
    Offline

    miamidroid New Member

    Joined:
    Dec 29, 2009
    Messages:
    89
    Likes Received:
    0
    Trophy Points:
    0
    ok I got this working on my mac and have been able to not only root my droid but also instal 2.1 and wifi tether. If anyone needs any help let me know. I know at first I was a little confused on how to get the commands going but now I feel I understand it somewhat, atleast enough to follow write-ups...
  18. Nomsy79
    Offline

    Nomsy79 New Member

    Joined:
    Aug 5, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Please Help

    Thanks for the post guys...I know it's an old one but it was very helpful. I've been reading through everything and I still can't seem to get this to work. This is whats happening:

    I keep getting an error in Terminal saying that the file or directory cannot be found. I am putting in cd/Users/name/Desktop/android-sdk-mac_86/tools and nothing is happening. Am I typing in something wrong?

    Any help would be greatly appreciated! Thanks in advance.
  19. TryThrowCatchFinally
    Offline

    TryThrowCatchFinally New Member

    Joined:
    Dec 9, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Sorry for the 4 month late reply, but in the newer SDK, adb has moved from tools to platform-tools. Hope this solves your problem. :)
  20. jaebond
    Offline

    jaebond New Member

    Joined:
    Dec 21, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Perfect reply! Thank you!
Search tags for this page

adb command not found mac

,
adb mac terminal
,
adb terminal mac
,
adb: command not found mac
,
how to run adb mac
,
how to run adb on mac
,
mac -bash: adb: command not found
,

mac adb command not found

,
mac adb not found
,
mac run adb
,
mac terminal adb
,
mac terminal android
,

run adb on mac

,
running adb on mac
,
using adb on mac