Startup for the Mac


Last Updated:

  1. ruffy

    ruffy New Member This Topic's Starter

    Joined:
    Mar 25, 2009
    Messages:
    4
    Likes Received:
    0
    As one of the 1st setup tasks, documentation.html states:
    "On a Mac, look in your home directory for .bash_profile and proceed as for Linux. "

    Well, my Tiger version - has no such directory.
    So what now? (...thanks.)
     

    Advertisement
  2. justjimjpc

    justjimjpc Premium Member VIP Member

    Joined:
    Nov 3, 2008
    Messages:
    10,543
    Likes Received:
    210
    You haven't told anyone what you are trying to setup ... so it is a bit hard to help ???
     
  3. Ageless Stranger

    Ageless Stranger Well-Known Member

    Joined:
    Dec 2, 2008
    Messages:
    699
    Likes Received:
    49
    I don't have a Mac but I can help with bash, the file .bash_profile is a hidden file that resides in the users home directory. If you can get to the command line type the following

    ls .bash* -l

    -l is lowercase -L in case the font is confusing.

    if .bash_profile is missing *and* and you have a file called .bashrc then in the command line type

    cp .bashrc .bash_profile


    Hope this helps, once again I don't have a Mac but I can navigate around bash pretty well.
     
  4. ruffy

    ruffy New Member This Topic's Starter

    Joined:
    Mar 25, 2009
    Messages:
    4
    Likes Received:
    0
    justjimjpc - What do you mean; All I want to do
    is INSTALL the Android SDK?! Nothing more than
    that.

    ageless stranger - That command came up empty.
    Do I have to be in a particular directory for it to
    work?
     
  5. justjimjpc

    justjimjpc Premium Member VIP Member

    Joined:
    Nov 3, 2008
    Messages:
    10,543
    Likes Received:
    210
    No problem ... but that was not obvious to me in your post ... as there was no mention of "INSTALL SDK" in your original post
     
  6. Ageless Stranger

    Ageless Stranger Well-Known Member

    Joined:
    Dec 2, 2008
    Messages:
    699
    Likes Received:
    49
    Like I said I havent got a Mac so I was just going by my Linux experience. The .bash* files live in the home directory. Try typing cd ~/ first before typing what I said earlier. If that doesn't work then you will have to find a Mac expert.
     
  7. devolio

    devolio Well-Known Member

    Joined:
    Oct 30, 2008
    Messages:
    339
    Likes Received:
    37
    You can also try ~/.bashrc

    But like the above posters, I don't have a mac to test on.
     
  8. hallow

    hallow New Member

    Joined:
    Mar 27, 2009
    Messages:
    3
    Likes Received:
    0
    You should use ~/.bash_profile. The file does not exist by default. You have to create it. You can create it with the command "touch ~/.bash_profile". "~/" is the command line shortcut for Macintosh HD -> Users -> your_user_name (commonly referred to as your "Home" folder, and the icon for which looks like a house.

    In the .bash_profile, you want to add android's tools folder to the system PATH. To do that you need to add a line exporting the PATH environment variable, or append to it if it already exists.

    For a brand new entry, you need to create a line that looks like this:
    export PATH=$PATH:/usr/local/android/tools

    For an existing line, you just add :/usr/local/android/tools to the end of the line. This is assuming of course you have the sdk installed as /usr/local/android. I did this using a symlink, which makes it easy to switch between sdk releases should I ever need to, without having to touch the .bash_profile or my eclipse configuration. I just change the symlink.

    Here's 6 commands to sdk bliss (how I did it on my mac).
    # download the sdk
    curl -C - -O http://dl.google.com/android/android-sdk-mac_x86-1.1_r1.zip

    # unzip to /usr/local
    sudo unzip -d /usr/local android-sdk-mac_x86-1.1_r1.zip

    # symlink for easy to change out versions
    sudo ln -s /usr/local/android-sdk-mac_x86-1.1_r1 /usr/local/android

    # create the .bash_profile if it doesn't exist
    touch ~/.bash_profile

    # edit your .bash_profile, creating or adding to the export PATH= line
    /Applications/TextEdit.app/Contents/MacOS/TextEdit ~/.bash_profile

    # load for the existing terminal session
    source ~/.bash_profile
     
  9. hallow

    hallow New Member

    Joined:
    Mar 27, 2009
    Messages:
    3
    Likes Received:
    0
    FYI, these instructions should basically work for Linux too, you just have to change the editor to emacs or vi or whaterver, rather than TextEdit (which I figured would be easier for a mac user who's not too familiar with unix).
     
  10. ruffy

    ruffy New Member This Topic's Starter

    Joined:
    Mar 25, 2009
    Messages:
    4
    Likes Received:
    0
    Thanks Hallow, now we're getting somewhere.
    Bear with me a bit, though, because those command line
    instructions still read Chinese to me.

    I did get the .bash_profile created with the
    "touch" command.
    I know that because the search for the file
    with ~/.bash_profile no longer reports a missing
    file. But, because the filename starts with a period,
    the file's hidden.

    How do I get to unhide it, for one,
    and how do I get to edit it with TextEdit?
     
  11. Ageless Stranger

    Ageless Stranger Well-Known Member

    Joined:
    Dec 2, 2008
    Messages:
    699
    Likes Received:
    49
    dot files like .bashrc are effectively "hidden" files, putting a dot in front of any file will "hide" it from file browsers (unless they are told to show hidden files) and from command line commands like ls (unless you use ls -a)
     
  12. hallow

    hallow New Member

    Joined:
    Mar 27, 2009
    Messages:
    3
    Likes Received:
    0
    1) You don't unhide it. There actually are some ways to do this, but it's not necessary. If you really must, see macosxhints.com -- macosxhints.com - Show hidden UNIX files in the Finder

    2) You can open it in TextEdit using the command line:
    /Applications/TextEdit.app/Contents/MacOS/TextEdit ~/.bash_profile
     
  13. ruffy

    ruffy New Member This Topic's Starter

    Joined:
    Mar 25, 2009
    Messages:
    4
    Likes Received:
    0
    Hallow - I can now invoke TextEdit directly after unhiding the bash
    file, or using the terminal command as you showed me.

    Does this line look right to you?
    export PATH=${PATH}:~/desktop/android-sdk-mac_x86-1.1_r1/tools

    Thanks again (for taking me by the hand). Much obliged!
     

Share This Page

Loading...