HTC Hero USB Tether on Mac OS X

Recently I got brand new HTC Hero – great android based phone. Since my previous phone (Nokia N73) has been working with Mac without any problem I was very disappointed to figure out that I have to deal with Windows for syncing my phone with computer and firmware upgrades.
After I upgraded it to latest official 2.73.405.4 ROM, I used Google Contacts/Calendar apps to sync my previous Nokia 73 stuff with Google and Hero, so having laptop<-->mobile connection to Internet (tethering) really sounded like something possible to achieve. A friend of mine with HTC Magic told me about way to connect to Internet with Wifi Tether application, which works on root-ed devices only. So after I passed trough complete rooting procedure explained here and here, I gained root access but still wasn’t able to make Wifi Tether work with Mac. Hero was visible as another AP, and even thought Mac was actually able to connect to it, I never got “outside” access to the Internet and eventually gave up. I found some threads that modaco custom ROM might be solution but figured that for newbie in android world like me, chances to brick brand new device while doing unsupported ROM upgrade are not so low so eventually I gave up.

Unlike for wifi tethering, USB tether for Hero and Windows comes “Out of the Box” (all you have to do is to turn on mobile sharing) but unfortunately it doesn’t work with a Mac. When you connect Hero to Mac, instead of new network device Mac see it as modem, but if you try to dial (like with *99#) you obviously get an error.
After I spent several hours reading endless discussions on various forums, today I finally managed to connect my MacBook Pro on the Internet with my HTC Hero mobile Internet (EDGE/GPRS/3G/HSDPA) connection.

Before I delve into instructions, please bear in mind that although this tutorial is based on HTC Hero and Mac running on latest (10.6.1) Snow Leopard, as far as I can tell it should be working with any other Android device or older version of Mac. I assume that you have MacPorts installed and that you are able to connect to Internet with your Mobile Phone.

Prepare your phone
You are going to install azilink on your phone. Since all tether applications are removed from Android Market, you have to download it directly from site. But before you do that, you have to make sure that installing applications from unknown sources is allowed. So Press Home, then Menu->Settings->Applications and make sure that “Unknown Sources” is checked. Also in Development menu make sure that “USB Debugging” is checked.

Now on your phone open browser and go to , download file and follow install instructions. Once azilink application is installed start it and make sure that “Service Active” option is checked.

Prepare your Mac
Step1: TuneTap App
Download and install tuntap for Mac OS X ( on the Mac and restart your mac.

Step2: Android SDK
Download Android SDK ( for Mac and unpack it somewhere on your machine. I used my $HOME dir (/Users/dinke) so I unpacked whole folder and named it android-sdk so full path is /Users/dinke/android-sdk. Since you are going to call tools from that folder, we have to put it into our $PATH variable by editing $HOME/.bash_profile file. I assume that you don’t have UNIX experience so this is step by step guide :

1) Open Terminal Applications
2) Type:


and hit enter
3) You are now in your home dir (ie. /Users/dinke). Now you are going to edit .bash_profile file with pico editor :

pico .bash_profile

4) Add this line to last line of file:
export PATH=/Users/dinke/android-sdk/tools:$PATH
(replace /Users/dinke/android-sdk/tools with actuall path on your system)
5) Hit ctrl-x then answer Y and hit enter

Now you should be ready to call android tools (like we are going to do later) without specifying full system path.

Step3: OpenVPN2 App

Download and install openVPN2 . We will use MacPort’s port command for doing that. So again open terminal application and type:

sudo port install openvpn2

Now application will be automatically downloaded and compiled. This will take a while, and if this end without any error message you are good to go further :)

Step 4: azilink.ovpn file

1) Download file
2) Create folder openvpn in $HOME/library folder (so you have new folder in for example /Users/dinke/Library/openvpn
3) Edit file azilink.ovpn and comment out line 8 with TCP_NODELAY (so it may looks like this):

dev tun

remote 41927 tcp-client
proto tcp-client
#socket-flags TCP_NODELAY
#keepalive 10 30
ping 10
dhcp-option DNS

4) Save file in new created in new created openvpn folder

Step 5: Modem script

1) Download script from (there is download link on top right) and save it somewhere on your system. I assume you saved it under our home dir as (/Users/dinke/
2) Give that script executable privileges. So open terminal application and type this:
chmod 777 /Users/dinke/
(change path and script name according to your system)

Now we are almost done and we are ready to test actual connection. So connect your phone with Mac with USB cable, open terminal app and type this:

adb devices

You should get something like this:

dragan-dinics-macbook-pro:tools dinke$ adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT9FSL901734    device
dragan-dinics-macbook-pro:tools dinke$ 

If you get error (like command not found) check path setting for android sdk tools. If your device is not listed check that it is connected properly. If everything looks ok (you get device id listed) then we can connect our phone to Internet and run actual connection script. Make sure that your phone is connected to Mobile Internet (go to Menu->Settings->Wireless Controll and check Mobile Network checkbox), and then assuming that you’ve saved modem script under /Users/dinke/ you can run it by typing absolute path in terminal:


and you should get output like this:

dragan-dinics-macbook-pro:~ dinke$ /Users/dinke/
Tue Nov 10 03:33:53 2009 OpenVPN 2.0.9 i686-apple-darwin10.0.0 [SSL] [LZO] built on Nov  9 2009
Tue Nov 10 03:33:53 2009 IMPORTANT: OpenVPN's default port number is now 1194, based on an official port number assignment by IANA.  OpenVPN 2.0-beta16 and earlier used 5000 as the default port.
Tue Nov 10 03:33:53 2009 ******* WARNING *******: all encryption and authentication features disabled -- all data will be tunnelled as cleartext
Tue Nov 10 03:33:53 2009 gw
Tue Nov 10 03:33:53 2009 TUN/TAP device /dev/tun0 opened
Tue Nov 10 03:33:53 2009 /sbin/ifconfig tun0 delete
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
Tue Nov 10 03:33:53 2009 NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Tue Nov 10 03:33:53 2009 /sbin/ifconfig tun0 mtu 1500 netmask up
Tue Nov 10 03:33:53 2009 ./ up tun0 1500 1502 init
add net gateway
add net gateway
Tue Nov 10 03:33:53 2009 Attempting to establish TCP connection with
Tue Nov 10 03:33:53 2009 TCP connection established with
Tue Nov 10 03:33:53 2009 TCPv4_CLIENT link local: [undef]
Tue Nov 10 03:33:53 2009 TCPv4_CLIENT link remote:
Tue Nov 10 03:34:03 2009 Peer Connection Initiated with
Tue Nov 10 03:34:03 2009 Initialization Sequence Completed

If you get some errors make sure that you’ve passed correctly trough all needed steps. If no errors found, it is good time to test your new internet connection. You can do so by trying to ping some site or simple opening browser and visiting some Web Site. It should be working just fine!

My HSDPA connection with USB Tethering
Speedtest of my HSDPA connection with Telenor Serbia

Usefull Links:


  1. Cher
    August 17th, 2010 | 6:00 pm

    I have the same problem as Pete. starts and runs just fine. I can connect to Skype, iChat, other things of through whichever port chat interfaces use, but no web browsing (Chrome, FireFox or Safari) and I cannot connect to externals via ssh or ftp.

  2. Cher
    August 17th, 2010 | 7:01 pm

    RE: to me and to Pete

    I had turned off Airport, but turning it on made everything work!

    Thanks Dinke!

  3. August 18th, 2010 | 11:11 pm

    You’re lucky Cher – it doesn’t work for me. I tried leaving wifi on but connecting to a dud wifi address which gives me no internet access.

    Weirdly Skype does work just like you said. Azilink counters clock up traffic with Skype. But no browsers work.

    Something to do with DNS? Any ideas?

    When I look at network preferences what should I see – I see a “Parallels Shared Networking Adapter” and a “Parallels Host-Only Networking Adapter”. Is that right?

    How should they look?

    Many thanks for any help

  4. motionpotion
    September 13th, 2010 | 9:19 am

    Why go through all that work when all you need to install is aNetShare?

  5. October 15th, 2010 | 10:40 pm

    Because aNetShare simply doesn’t work for me. I root-ed my Hero and tried both wifi tether as well as anetshare, none of them seems to work with my MBP. Airport see it on wifi list, but when I try to connect it it doesn’t work.

    That’s why I use USB method explained above.

  6. Flyer
    October 26th, 2010 | 4:07 pm


    I’m a HTC Tattoo user. While following your instruction to prepare my phone, I run into a problem. After installing openVPN, I was asked to install TunnelBlick which I did too. However, from there on, I do not know how to download the client.ovpn file. Could you kindly explain explicitly how to do this steps?


  7. david
    October 27th, 2010 | 2:31 am

    Tue Oct 26 20:29:17 2010 OpenVPN 2.1.1 i386-apple-darwin10.4.0 [SSL] [LZO2] built on Oct 26 2010
    Tue Oct 26 20:29:17 2010 NOTE: the current –script-security setting may allow this configuration to call user-defined scripts
    Tue Oct 26 20:29:17 2010 ******* WARNING *******: all encryption and authentication features disabled — all data will be tunnelled as cleartext
    Tue Oct 26 20:29:17 2010 TUN/TAP device /dev/tun0 opened
    Tue Oct 26 20:29:17 2010 /sbin/ifconfig tun0 delete
    ifconfig: ioctl (SIOCDIFADDR): Can’t assign requested address
    Tue Oct 26 20:29:17 2010 NOTE: Tried to delete pre-existing tun/tap instance — No Problem if failure
    Tue Oct 26 20:29:17 2010 /sbin/ifconfig tun0 mtu 1500 netmask up
    Tue Oct 26 20:29:17 2010 /Users/David/Desktop/ up tun0 1500 1502 init
    /Users/David/Desktop/ line 22: scutil: command not found
    Tue Oct 26 20:29:17 2010 script failed: could not execute external program
    Tue Oct 26 20:29:17 2010 Exiting

    This is the error I am getting. However, when I type “sudo scutil” in terminal alone, I am getting it work. I even tried using the full file path. Please help, I am braindead right now.

  8. William
    May 16th, 2011 | 9:09 am

    This is the error I am getting. However, when I type “sudo scutil” in terminal alone, I am getting it work. I even tried using the full file path. Please help, I am braindead right now.

    I was too. Who can tell me how to deal with this problem?

  9. August 30th, 2011 | 7:24 pm

    […] to work very well together. I found this thread which explains it but I dont really understand it? Caught in a Web HTC Hero USB Tether on Mac OS X. Any help greatly […]

  10. November 23rd, 2011 | 9:12 am

    What’s the suggested phone settings on htc hero for optimum performance when streaming video threw easy tether pro?

  11. casey
    December 3rd, 2011 | 11:08 pm

    adb devices gives me ‘command not found’

  12. April 15th, 2012 | 2:32 pm

    Even though all of the problems are solved in the comments above, I’ll try to summarize the solutions:

    1. Android SDK, as of r16, does not include adb by default. You have to run android-sdk/tools/android, and install the Platform Tools. adb will be put to android-sdk/platform-tools/adb (you should add this directory to PATH).
    2. USB debugging should be turned on on the phone.
    3. –script-security 2 should be added to the openvpn2 call in, and the path to scutil should be specified (see for the fixed version).
    4. You might want to disable Skype, Evernote and other bandwidth-consuming apps if your data plan / bandwidth are tiny.

    Ah, BTW: I’ve just successfully set it up on Mac OS X Lion. Posting this via the mobile connection. :)

Leave a reply