Tethering Your Android Phone to OS X via USB

Much of the credit goes to the article here: http://thinkden.com/index.php/general/admin/75 but there is a thing or two he glosses over which for the average user may make it more difficult to figure out so I figured I’d complete it out.

  1. Download the following: TunTap for Mac OS X, Tunnelblick for Mac OS X, Azilink (both the zip and apk files), and the Android SDK.
  2. Install TunTap and then restart your Mac.
  3. Install Tunnelblick (once the DMG mounts and opens, drag the Tunnelblick icon to your Applications folder).
  4. Unzip (open) the Azilink zip file, now go to your $HOME/Library/ folder and create a new folder called “openvpn”, copy the file “azilink.opvn” from the zip file you opened into this newly created folder. After doing this, right click on the “azilink.opvn” file and choose Open With > Other and then choose TextEdit. There is a line that says “socket-flags TCP_NODELAY”, you will want to comment this out, so add a “#” to the beginning of it so that the line now looks like “#socket-flags TCP_NODELAY”, save and close the file.
  5. Unzip (open) the Android SDK zip file, and copy the adb program to your Desktop, you’ll find it in the tools directory of the zip file.
  6. Enable USB debugging on your Android device, this can be found at Settings > Applications > Development > USB debugging.
  7. Now we need to install the Azilink apk file and setup the port forwarding on your Android device. So connect the USB cable from your Mac to your Android device, do not mount the SD card though. Open the terminal app, and cd to your Desktop, and run “./adb install /location/you/downloaded/apk/to” after it has completed install, then run “adb forward tcp:41927 tcp:41927”.
  8. Start the azilink app on your Android device, and when it comes up, check the “Service active” switch, it should say “Waiting for connection” under status once you do this.
  9. Now start the Tunnelblick app on your Mac, you should see status switch to “Connected to host” on your Android device, now you’re ready to share (tether) the active network connection on your Android device with your Mac.

Hope this helps make it a little more simple for the average user out there, let me know if I made any typos or missed something.

38 Responses to “Tethering Your Android Phone to OS X via USB”

  1. Dave Winer Says:

    Not sure I understand — what does tethering allow you to do? Does the Droid connect to the Internet through the Mac, or is it the other way around? Or something else entirely?

  2. Josh Turmel Says:

    This allows you to share whatever network connection that your phone has with your computer (my Macbook in this case) over USB. The main advantage is that you do not have to root your device, which is great since the average user doesn’t want to attempt to root their device.

    If you already carry a Mifi device then this probably isn’t a big deal.

  3. chase morgan Says:

    I got to step 7 and I’m not to familiar with terminal when you say “adb install /location/you/downloaded/apk/to” what do I put as location, and what should I replace with you maybe you could make that whole step a little clearer as that is the only part I don’t get.
    Thanks in advance

    • chase morgan Says:

      figured out how to get the abd installer in there just hung up on port forwarding now?????

      • Josh Turmel Says:

        So I take it that you installed the app using “adb install” that you know how to use adb via the command line in some form.

        All you need to do now is make sure you have the phone plugged in via USB, however do not mount the SD card, just plug the phone in and that’s all. Now run this “adb forward tcp:41927 tcp:41927”, this basically forwards any port requests on your local machine to tcp port 41927 to tcp port 41927 on the device.

  4. chase morgan Says:

    No i used apk installer from inside the phone. Because I don’t understand the simple phrase “run this” I don’t have a clue as to what to type or where to type it I really tried I swear. If it were I a padlock I would have cracked it by now because I tried every possible combination of what you said but “Run This” isn’t very clear

    • chase morgan Says:

      I understand the concept just not all the details of where I need to be when putting this command in and what I need to type before it. Thanks again

    • Josh Turmel Says:

      Are you familiar with the Terminal.app in OS X?

      • chase morgan Says:

        No I’ve never really used terminal just command prompt if you can explain the port forwarding and what exactly I need to type to change that setting a little more I will be set

    • Dave Brock Says:

      put the ADB file and the azilink.apk file on the desktop to make it easier. then in terminal enter /Users/(your username)/Desktop/adb (whatever command necessary)

      for instanace, enter this in terminal to adjust the port forwarding: “/Users/(your username)/Desktop/adb forward tcp:41927 tcp:41927”

  5. John Says:

    I have successfully followed the detailed instructions, but cannot connect to the internet unless my AirPort is turned on. Tunnelblick will show 1 active connection, and the phone will display “Connected to Host”. Safari says I have not internet connection once I turn off the airport. Any thoughts?

    • Reid Says:

      I’m having the same issue, everything seems connected… I’ve tried Safari & Firefox with no luck. When I have the airport card ON the byte counters advance (quickly) in the AziLink app. But with it OFF, nothing.

      Using a Droid… if it makes any difference.

      • Elev8ioN Says:

        Ok, what you are missing is very simple. You need to open Firefox. Go to Firefox preferences-Advanced-Network(configure how Firefox connects to the Internet) Settings…
        Manual proxy configuration:
        HTTP Proxy: localhost Port: 41927
        checkmark “Use this proxy server for all protocols

        hit the “OK” button and Firefox is now configured to use tcp port 41927 instead of your Mac’s airport/ethernet port.

        This should fix the problem of being connected but not being able to connect to the internet thru your phone. Firefox just had to be told to use the port that is being used for forwarding.

        I hope this helps.

        Even easier, upgrade your Droid’s ROM to Ultimate Droid v8 and you will have a “WiFi” tether application installed. This application turns the Droid into a “Wireless Router” so to speak and will be available using your Mac’s airport. You will need to go to the Droid Forums for instructions on how to upgrade your ROM to “Ultimate Droid v8” if you are not familiar with linux, unix or Mac’s Terminal.

  6. Josh Turmel Says:

    Keep in mind guys, this is a more advanced procedure, if you’re having trouble with it you might want to look into using something like PdaNet, we have a post on that here: http://droidie.com/2009/11/10/can-android-tether-today-for-0-extra/

    • chase morgan Says:

      yeah I used that under bluetooth dun it’s easy just super slow though. I can do anything with a tutorial worded right. Every guide I find though looks like its been copied and pasted from the last site I pulled up. Here is what I get in terminal
      Last login: Wed Nov 18 16:15:02 on console
      queefbreath:~ chasemorgan$ adb forward tcp:41927 tcp:41927
      -bash: adb: command not found
      queefbreath:~ chasemorgan$ run/adb forward tcp:41927 tcp:41927
      -bash: run/adb: No such file or directory
      queefbreath:~ chasemorgan$ run /adb forward tcp:41927 tcp:41927
      -bash: run: command not found
      queefbreath:~ chasemorgan$ adb forward tcp:41927 tcp:41927
      -bash: adb: command not found
      queefbreath:~ chasemorgan$

      • Josh Turmel Says:

        I can see from your prompt that you’re not on your Desktop and you are in your Home folder (as represented by the tilde), if you extracted the adb program to your desktop per the instructions then “cd” to your Desktop and then you’ll be able to run the adb program. The command you’ll run is “adb forward tcp:41927 tcp:41927”.

  7. chase morgan Says:

    ast login: Wed Nov 18 18:14:18 on ttys000
    queefbreath:~ chasemorgan$ run/adb forward tcp:41927 tcp:41927
    -bash: run/adb: No such file or directory
    queefbreath:~ chasemorgan$ adb forward tcp:41927 tcp:41927
    -bash: adb: command not found
    queefbreath:~ chasemorgan$ run /adb forward tcp:41927 tcp:41927
    -bash: run: command not found
    queefbreath:~ chasemorgan$ cd /users/chasemorgan/desktop/
    queefbreath:desktop chasemorgan$ adb forward tcp:41927 tcp:41927
    -bash: adb: command not found
    queefbreath:desktop chasemorgan$ run/adb forward tcp:41927 tcp:41927
    -bash: run/adb: No such file or directory
    queefbreath:desktop chasemorgan$ run /adb forward tcp:41927 tcp:41927
    -bash: run: command not found
    queefbreath:desktop chasemorgan$

  8. Josh Turmel Says:

    I’m assuming way too much here… it’s the details, the details. Apps need to know where they’re running from, so when you’re running from the same directory you’re in, you need to append “./”.

    Hopefully this gets you up and running.

  9. Droidmau5 Says:

    First off thanks for this info. I was not familiar with terminal at all before this endeavor but after playing around with it for a while I finally got it to work. I thought I might try and shed a little light in the areas I had some trouble.

    If you put the adb program on your Desktop, like the author suggest then the first thing you have to type in terminal is

    “cd desktop” without the quotes obviously

    next type “./adb install”

    Android Debug Bridge version 1.0.25 should come up with a list of commands

    finally type “./adb forward tcp:41927 tcp:41927”

    after that follow steps 8 & 9 and you should be in business.

    I am clocking speeds between 1.9 – 2.2 mbs, not bad.

    • chase morgan Says:

      thanks alot man you gave me the stupid f!@#ing info that i was trying to milk the author for like three days. Jeezus not everyone is a freakin software developer

      • Josh Turmel Says:

        I posted the “./” for you above, did you miss it? I was trying to help you out, you can lose the poor attitude.

      • chase morgan Says:

        its just ridiculous how ez it could of been for you to put the two together ./adb install instead of just ./ had no clue what that applied to ended up typing every possible combination except that. not trying to be a jerk but i spent hours upon hours trying to get it to work, and with that one comment it took two seconds

  10. Geoff Arias Says:

    Quick question. Step 8 says to run the app on your phone. How do you get the app on your phone? Drag and drop from your computer to the phone?

  11. Geoff Arias Says:

    OK so I have azilink on my phone via direct download from phone browser. My phone says connected to host and the byte counter reads received and sent bytes. Tunnelblick says I’m connected to azilink. Yet when I open safari I doesn’t bring up a website. Please help. What is the problem? Everything connects how do I Aug the internet?

  12. Geoff Arias Says:

    Josh your tutorial is helpful. I just have having that one problem. I can’t get Safari to show a website. Bytes advance tunnel shows active connection and phone says connected to host. Any ideas? Maybe try to be as detailed as possible. Im decently computer savvy and am still struggling to get this thing up and tethered. Your help would be greatly appreciated.

    • AgDude Says:

      I am having the same problem. Running 10.6.1. Azilink is connected on the phone, and I can use SSH through terminal, but safari won’t show a page. Is there something I need to set in the network preferences?

  13. JWK Says:

    Hi Josh, thanks for the very helpful tutorial. I have everything going so far but the port forwarding. Here’s what I’m getting when I try to work with the adb program:

    macbook:~ Wesley$ cd desktop
    macbook:~/desktop Wesley$ ./adb install
    -bash: ./adb: cannot execute binary file
    macbook:~/desktop Wesley$ ./adb forward tcp:41927 tcp:41927
    -bash: ./adb: cannot execute binary file
    macbook:~/desktop Wesley$

    Any suggestions?

  14. Josh Turmel Says:

    Post has been updated to be more clear on how to run the adb app from the command line.

  15. Mario Says:

    I am having same problem connecting with browser. Droid and MAC are connected and moving bytes. but shows no TCP connections.

  16. Tarean Says:

    I’m having trouble running adb, after I type the “./adb install” command, it says “cannot execute binary file”. I’m running 10.4.11 on a Macbook with an Intel Core 2 Duo, is that a part of the problem?

  17. Dhyanesh Says:

    For all those who have connected fine but are unable to open any site in Safari. Tunnelblick does not set the nameserver correctly. This needs to be set manually which seems to be a pain from what all I have found.

  18. iam Says:

    Thank you, this is awesome and free. I really like all the extra details that pdanet doesn’t show.

    A couple things that might help a newbie.

    In terminal the command “ls” will show you where you are so you can “cd” to your desktop or to where you have the files stored.

    I forgot that to run something it must be appended with”./” so I’m glad it was mentioned in the comments.

    “$HOME/Library/” should be the name of your account not the main Macintosh HD Library. You will get a message when you start the Tunnelblick app if you did this wrong so quit the app and move the “openvpn” you created.

    If you drag and drop a file in terminal it will show you the path. Like this part “./adb install /location/you/downloaded/apk/to” you could type “./adb install ” that is a space at the end then drop the “azilink-x.x.x.apk” file.

    Thanks again, Whoot whoot

  19. Alissa Says:

    I can’t get Tunnelblick to start correctly. When I double click the icon, this is what I get: Tunnelblick could not be launched because of a problem with the configuration. Please examine the Console Log for details.

  20. Shaun Beavan Says:

    FYI I had to upgrade my installed TunTap and TunnelBlick for this to work. I had a previous installation for connecting to my Home VPN. Once installed it worked smooth as butter Thank You!!!

  21. C Perez Says:

    Gretings,

    I have a few questions but first will mention that I have done the following already.
    1. Installed TunTap and Tunnelblick (fresh versions off of their respective website, so I know I have the latest versions as of 2/26/10
    2. Installed the Azilink.apk on my Droid.
    3. created the Home/Library/openvpn folder and tossed the azilink.ovpn file in there (and modified the line that needed to be commented out).
    4. Launched the Azilink app on the Droid and activated the service.
    4. Executed the “./adb forward tcp:41927 tcp:41927” line in the terminal.
    5. Launched Tunnelblick BUT I get the following error (copied form the console):

    2/26/10 9:18:15 PM Tunnelblick[283]

    Error: Both /Users/crperez/Library/openvpn and /Users/crperez/Library/Application Support/Tunnelblick/Configurations exist and are folders, so /Users/crperez/Library/openvpn cannot be moved

    What is wrong?

    I have executed all the instructions on this blog to the letter only to be stopped by this.

    Secondly, each subsequent time you wish to tether after the initial time, do you have to execute the “./adb forward tcp:41927 tcp:41927” command or is that only on the initial setup?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: