1. In regards to recently combined carrier specific root forums, if your device forum was affected, please see this poll/thread!

Mac OS X Droid Tethering (USB/Wired)


  1. droppedD

    droppedD Member

    Joined:
    Nov 16, 2009
    Messages:
    9
    Before we start: [[insert usual disclaimers about this technically violating the Verizon TOS]]. With that out of the way :)...

    PDANet looks like a good solution for battery-chewing Bluetooth DUN tethering, but their $30 proprietary desktop app is for wired tethering on Windows only. Where does that leave us OS X folks who want a straightforward wired tethering solution, or something open source?

    I've tried Tetherbot + Foxyproxy, but that's Firefox-only and I never could get the DNS to resolve properly through the phone's connection.

    I stumbled on azilink, which works by running a vpn tunnel through your phone. But azilink is strongly biased towards Windows users, to the point that the author says "if you're using linux, or god forbid, OS X..." in his directions. And the preferred client for azilink, OpenVPN 2, is a headache to install directly on OS X (you can install Macports or build it by hand from source, but that's a nonstarter for most users).

    That said, with a little setup work, you can get everything to tether by running one shell script. I assume you know your way around a BASH prompt here (if you don't, this is decidedly not the right solution for you).


    • - Enable USB debugging and 3rd-party app installation (System Settings -> Applications -> check Unknown Sources; Development -> check USB debugging).
    • - Install azilink on the phone.
    • - Install the Android SDK to get the adb tool
      • - Either add the SDK's tools folder to your PATH or copy adb to /usr/local/bin/
    • - Install Tunnelblick, a nice OS X VPN GUI that runs on OpenVPN2. Just copy it to your Applications folder, and run it to set up your system. (I used Tunnelblick 3.0b22).
    • - Get the activate/deactivate shell script from #701122 - Pastie and save it as, for example, ~/azilink.sh
    • - Make the script runnable (e.g. "chmod 744 ~/azilink.sh" at the Terminal)

    Phew! But once that initial setup is done, all you have to do to tether your phone is:


    • - Run azilink on the phone and check the box to start the service.
    • - Run the script ("~/azilink.sh") on your Mac from Terminal.
    When you're done, ctrl-c tears down the connection.

    To make it even easier in the future: Right-click the shell script in the Finder, choose Get Info, and Open With -> Applications/Utilities/Terminal (DON'T apply that to all; that could be risky). Then you can run the script by just double-clicking it in the Finder without having to go through manually starting a Terminal session.

    That pre-first-run setup's a bit of a hassle, but it should be *much* more friendly on the batteries than BT or Wifi-based solutions, and this runs using entirely free open-source tools.

    Big thanks to Mochabyte on the xda-developers Dream forum for doing most of the hard work; I just streamlined the process to not require macports and openvpn2 from source, and added (hopefully) straightforward directions for the whole setup process.
     
    Advertisements
    dannygin108 and lordawesome like this.
  2. chris.h

    chris.h Well-Known Member

    Joined:
    Oct 28, 2009
    Messages:
    78
    I needed to enable usb debugging on my device, then it took 3 tries to make the connection.

    also, an executable apple script can probably run the shell script to cut out having to open terminal.
     
  3. droppedD

    droppedD Member

    Joined:
    Nov 16, 2009
    Messages:
    9
    Updated with instructions about USB debugging (Sorry - I turn that setting on the second I get a phone; totally forgot about it).

    Also updated with instructions on making it "one click" from inside OS X.

    If anyone wants to throw together an Applescript or Automator up/down script for this to hide the ugly bits, feel free; I spend 1/2 my day at the Terminal anyways, so I don't particularly mind :)

    You could also probably set up a configuration inside the Tunnelblick GUI app to do this that calls a bash script to do the DNS setup/teardown; but yet again, I live at the terminal anyways, so I personally won't bother.
     
  4. Muka

    Muka New Member

    Joined:
    Nov 18, 2009
    Messages:
    1
    I've put off registering for the forum, but just had to say thank you when I finally got this to work. This is a big deal for me--I really appreciate the good instructions!
     
  5. rrgrs

    rrgrs New Member

    Joined:
    Nov 20, 2009
    Messages:
    1
    your instructions worked great except i had to install some tuntap drivers to get everything to work, located at TunTap - Home
     
  6. jazzdan

    jazzdan New Member

    Joined:
    Nov 5, 2009
    Messages:
    2
    I had to do the same on my OS X 10.6.1 box. But once you install those drivers the above instructions work perfectly! Props op!
     
  7. JoeC

    JoeC Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Location:
    San Diego, CA, USA
    Just a note to this that one does need an Intel-based Mac to perform the procedure.
     
  8. doktopus

    doktopus New Member

    Joined:
    Nov 19, 2009
    Messages:
    2
    ok I am new to mac and am trying to learn my way around the bash prompt. I have downloaded and installed azlink to my droid. I have downloaded android-sdk-mac to my mac and put abd in usr/local/bin. I have downloaded and installed tunnelblick to my mac to intall openvpn. I am having trouble with the script from christie. first I tried highlighting it and saving but it will only save as a webpage. I the copied the script in applescript script editor and when I tried to save it to a folder I could come back to from the terminal it kept disappearing and also would not let me save it as azlink.sh. when I tried to run it from the script editor it said the script had syntax errors i.e. in the first line "{ cannot follow ()". when I copied it to a folder and just labeled it azlink and then try to change the name to azlink.sh the terminal window said no such file existed.
    please tell me how to get this script on my mac and saved as ~/azlink,sh so I can run the chmod 744 command on it. azlink is up and running on the droid. tunnelblick is up and running on the mac. also I have OS X 10.6 running on the mac so if I have to use the above TunTap drivers do I just install them and then run the script or do they have to go to a specific folder.
    I know this all seems simple to you guys but you've got to start somewhere to learn something different i.e. mac and unix vs. windows.
    thanks in advance for any help.
     
  9. AdamTr

    AdamTr Member

    Joined:
    Nov 13, 2009
    Messages:
    6
    A much clearer instruction set would be appreciated. I know virtually nothing about Terminal and never heard the term "BASH prompt" before. However that being said, I've been a Mac user for nearly 2 decades so I do know my way around the system pretty well.

    The method laid out in this thread seems easy enough - if the instructions were dumbed down a little I think many more could take advantage of it :)
     
  10. Fabolous

    Fabolous Superuser VIP Member

    Joined:
    Nov 7, 2009
    Messages:
    3,635
    Location:
    Illinois
    I'm an OS X newbie, but after some playing around, I got this to work. It's only a temporary measure as my "Hackbook" is waiting on a Wifi card that works, but this is fast enough for now.

    So I found that the most confusing part(s) were putting adb into the usr/local/bin and then making the script.

    So all you need to do is download the Android SDK and drag the tools folder into your user folder in Finder (no need to enable hidden files, etc. to get into the usr folder).

    Also, the link to the script just shows the contents. But on the right side of the page, there is actually a link to download the (premade) file. I just saved it as azilink.sh in my user folder. Then you can just follow his terminal code word for word to allow it to be runnable.

    Also, I am running SL 10.6.2, so I had to download TunTap. If the script isn't working for you, you'll have to download it.

    EDIT: This also works with the Wifi connection! Much faster now, and more suitable for my purposes.
     
  11. ryandroid

    ryandroid New Member

    Joined:
    Nov 30, 2009
    Messages:
    4
    Ok I've done everything I can think of.
    It comes up as this terminal output:

    Last login: Mon Nov 30 00:35:04 on ttys000
    Ryan-Bs-MacBook-Pro:~ Sun$ /Users/azilink.sh ; exit;
    /Users/azilink.sh: line 17: adb: command not found
    Password:
    Mon Nov 30 00:37:36 2009 OpenVPN 2.1_rc20 i386-apple-darwin10.0.0 [SSL] [LZO2] [PKCS11] built on Nov 1 2009
    Mon Nov 30 00:37:36 2009 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
    Mon Nov 30 00:37:36 2009 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
    Mon Nov 30 00:37:36 2009 TUN/TAP device /dev/tun1 opened
    Mon Nov 30 00:37:36 2009 /sbin/ifconfig tun1 delete
    ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
    Mon Nov 30 00:37:36 2009 NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
    Mon Nov 30 00:37:36 2009 /sbin/ifconfig tun1 192.168.56.2 192.168.56.1 mtu 1500 netmask 255.255.255.255 up
    Mon Nov 30 00:37:36 2009 /Users/azilink.sh up tun1 1500 1502 192.168.56.2 192.168.56.1 init
    add net 0.0.0.0: gateway 192.168.56.1
    Mon Nov 30 00:37:36 2009 WARNING: potential route subnet conflict between local LAN [192.168.2.0/255.255.255.0] and remote VPN [128.0.0.0/128.0.0.0]
    add net 128.0.0.0: gateway 192.168.56.1
    Mon Nov 30 00:37:36 2009 Attempting to establish TCP connection with 127.0.0.1:41927 [nonblock]
    Mon Nov 30 00:37:37 2009 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Mon Nov 30 00:37:43 2009 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused
    Mon Nov 30 00:37:49 2009 TCP: connect to 127.0.0.1:41927 failed, will try again in 5 seconds: Connection refused

    It tries to reconnect every 5 seconds and fails to do so. My device is plugged in.
    *Service active is checkmarked and running on Azilink app on phone.
    *Running Mac OS X 10.6.2
    *Moto Droid Verizon running Android 2.0.
    *TunTap installed.
    *TunnelBlick Running

    In the /Users directory is:
    *azilink.sh
    *adb
    *also /Users/tools/adb

    Do I need the whole android-sdk-mac which is the 2.0 version in /Users or /Users/Sun:confused: | Sun is My user directory

    Also you will notice in the terminal output above it says:
    -----> /Users/azilink.sh: line 17: adb: command not found <-----
    What does this mean???:confused:

    Could anybody tell me what might be wrong with this?:D
    Much appreciated if you could.:D
     
  12. brocken

    brocken New Member

    Joined:
    Nov 30, 2009
    Messages:
    1
    Thanks so much for posting these great instructions! I am now connected via tethering on my commute and very happy (using Droid and Snow Leopard)! It is nice to not have to reboot to Windows just to use PdaNet.
     
  13. doktopus

    doktopus New Member

    Joined:
    Nov 19, 2009
    Messages:
    2
    make sure you have internet sharing turned on from your mac. it is under sharing in the system preferences. if that doesn't do it then type the following command in the terminal window. "adb forward tcp:41927 tcp:41927" no quotes
     
  14. Scottyent

    Scottyent Well-Known Member

    Joined:
    Nov 2, 2009
    Messages:
    94
    Location:
    College Park, MD
    although I haven't given this a shot.... it seems pretty simple, but my question is, will you be slammed down by Verizon for this? I know there was app to buy on blackberry that would give you free tethering, but it was not "legal" as far as verizon was concerned, and if they noticed you using it a lot, they'd slap you with the thousands or hundreds of dollars overage charges. What would this route lead to? I'd like to give it a shot and use it every once in awhile in the car, but i also don't want to risk that much as far as repercussions from Big Red...


    thoughts?
     
  15. Fabolous

    Fabolous Superuser VIP Member

    Joined:
    Nov 7, 2009
    Messages:
    3,635
    Location:
    Illinois
    ryandroid -- it needs to be in your actual user directory "Sun"
     
  16. Scottyent

    Scottyent Well-Known Member

    Joined:
    Nov 2, 2009
    Messages:
    94
    Location:
    College Park, MD
    Bump. Is anyone else concerned about being caught and charged tons of money?
     
  17. Jaxx10

    Jaxx10 Well-Known Member

    Joined:
    Nov 2, 2009
    Messages:
    81
    Installed/running all above apps on mac and on phone... but still cannot connect
    QUestion:

    1. IS there anything else that need to be done on tunnelblick ? because i installed it and when i click on it it connects and disconnects ...
    2. Web sharing ... I am selected to share my AIRPORt connection and select all option on the TO computers using ( ETHERNET, BLUETOOTH PAN, ETHERNET ADAPTOR (en3), FIREWIRE)
    3. Even istalled the TUNTAP app though not sure if i need it since im using MAC Leopard...

    Can someone Gtalk to me my user name is JAxx10 ...thanks
     
  18. ctlongley

    ctlongley Member

    Joined:
    Nov 6, 2009
    Messages:
    21
    Bump. Fantastic work on this one - I had it setup in matter of minutes and now I am tethered using USB - thanks a bunch!
     
  19. Jakal

    Jakal New Member

    Joined:
    Dec 6, 2009
    Messages:
    3
    Just received an email today from the techs at PDANET, and they say they are releasing a USB tethering version of their app for Droid/MAC in 2 weeks.:D
     
  20. chris.h

    chris.h Well-Known Member

    Joined:
    Oct 28, 2009
    Messages:
    78
    Don't they usually charge $40 for that, and what makes it any better than this method? I mean, typing ./azilink.sh isn't that difficult, is it?
     
  21. droppedD

    droppedD Member

    Joined:
    Nov 16, 2009
    Messages:
    9
    The simpler headache-free initial setup for novices, presumably. Doesn't matter much to me since I enjoy messing about with this stuff, but I know plenty of people who'd rather a one-step setup for $40 than spend 30-60 minutes wrestling with shell scripts and Unix permissions.
     
  22. MottoDroider

    MottoDroider New Member

    Joined:
    Dec 17, 2009
    Messages:
    1
    All works fine for me if i use the IP address for a website. How can i make it to resolve using DNS/DHCP ?
     
  23. Jaxx10

    Jaxx10 Well-Known Member

    Joined:
    Nov 2, 2009
    Messages:
    81
    Still havent received answers to these questions ... PLEASEE!?!?!?! anyone ?

    1. IS there anything else that need to be done on tunnelblick ? because i installed it and when i click on it it connects and disconnects ...
    2. Web sharing ... I am selected to share my AIRPORt connection and select all option on the TO computers using ( ETHERNET, BLUETOOTH PAN, ETHERNET ADAPTOR (en3), FIREWIRE)
    3. Even istalled the TUNTAP app though not sure if i need it since im using MAC Leopard...
     
  24. droppedD

    droppedD Member

    Joined:
    Nov 16, 2009
    Messages:
    9
    A few notes:

    You do NOT need to run Mac Internet Sharing.
    You may need to run Tunnelblick to have it in the background, but don't use Tunnelblick's icon to connect. Run the azilink.sh script to do the actual connection.

    Also, the azilink script *should* set your DNS settings appropriately. If not, you can try poking around the script's settings to use a different name server (by default it uses the phone's DNS settings, i think).

    I'm not sure about Leopard, but you don't need Tuntap on Snow Leopard - just Tunnelblick running.
     
    bmvakili likes this.
  25. jhp45auto

    jhp45auto Member

    Joined:
    Dec 19, 2009
    Messages:
    5
    On this note- keep in mind there are new mac users like myself and while I want to tether, no way I would attempt this "simple" procedure. Looks like I shall be shopping for the PDANET option.
     

Share This Page