• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How To Mac OS X Droid Tethering (USB/Wired)

droppedD

Lurker
Nov 16, 2009
9
3
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.
 
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.

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.
 
Upvote 0
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.
 
Upvote 0
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 :)
 
Upvote 0
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 :)

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.
 
Upvote 0
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:thinking: | 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???:thinking:

Could anybody tell me what might be wrong with this?:D
Much appreciated if you could.:D
 
Upvote 0
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?
 
Upvote 0
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
 
Upvote 0
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?

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.
 
Upvote 0
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...
 
Upvote 0
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.
 
  • Like
Reactions: bmvakili
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones