Thanks for this! However, I'm unable to get this working, let me know if you'd rather I post this as a github issue:
MacBook Pro 13" with 10.7.5
Droid Razr with Android 4.0.4
Verizon with mobile hotspot and I believe I had tethering working on a Windows laptop before.
Steps:
I have installed HoRNDIS and rebooted (tried install/reboot again just to be sure)
Plugged in my phone via USB
Enabled USB tethering and it says tethering error
There are no changes in the Network preferences on the Mac
One thing I would recommend is trying with a different USB cable. I have found that microusb cables are often flaky, and a flaky cable produces very weird and hard-to-diagnose errors.
I use a similar method for transferring media, since mtp doesn't work very well on Linux.
I wonder why did Google decide to implement mtp as the protocol of choice. I know why MSC was not ideal anymore, but it already has working tcp over usb. That can be used to implement so many different things like file sync, tethering, etc.
> I wonder why did Google decide to implement mtp as the protocol of choice
They presumably had iTunes in mind as the competition, MTP is a "standard" and many apps already implemented it. Of course it turned out to be 4 steps forward and one step back.
Actually iTunes uses tcp over usb[1] . Which is why this is so counterintuitive - adb already does everything on tcp over usb, why didn't they just use it for everything.
I hope it is not patent encumbered - I'm hoping at least Cyanogenmod can implement it.
Apologies for not being clear - I meant iTunes' functionality (sync collections of media) not implementation. Presumably Google thought it would be a neat shortcut using MTP since others would then write the media sync functionality (eg Media Monkey, Double Twist).
It was a good short term choice, but a bad one for the long term. And there is nothing stopping them adding a TCP based sync later.
You'll note however that they prefer you sync to the cloud and then Google handles cloud to your device rather going direct from local machines to the device. See Google Music etc.
On OS X 10.7.5 with a Nexus S running Android 4.1.2 I get the following in kernel.log:
11/15/12 9:55:40.019 AM com.apple.kextd: Can't load /System/Library/Extensions/HoRNDIS.kext - no code for running kernel's architecture.
11/15/12 9:55:40.022 AM com.apple.kextd: Load com.joshuawise.kexts.HoRNDIS failed; removing personalities from kernel.
Great project, btw. Can't wait to try it on another phone/computer and get it working.
That's pretty weird! Do you know if there's any reason why your machine would be running a 32-bit kernel? I didn't think that was still supported on Lion...
It's a 2007 MacBook, with a Core 2 Duo processor. I had been under the impression that it was running a 64-bit kernel. But it seems I was wrong. I believe that since Lion most Macs boot with a 64-bit kernel. I guess this model was left out.
Cool project; I was kind of hoping when I saw the title it was a way to emulate USB over MTP, and not have to use the absolutely rubbish Android File Transfer application... but alas, not the case. Oh well.
You've given my life purpose. By that I mean, AFT is the worst application I've used in my life, ever. It is that (un)reliable. And I need yet another side project.
Tangentially related - if anyone is using native wifi tethering on their Android with their Mac and having issues, try tethering over Bluetooth instead - I found it to be much more reliable.
You might be missing out on an easier way to do it. When I plug my Nexus S into Ubuntu and enable tethering, Network Manager recognises a new Ethernet device, acquires an IP address via DHCP, and I'm connected. I've never had to configure anything on the computer.
I think some HTC phones can do that; I don't think it was very popular, though.
It should be possible to do without rooting your phone; I think Koush was discussing a similar proposition (tethering a phone to a tablet) using Android's support for usermode VPN applications.
I've no use case for it, though, so you're on your own there :-) It would also not be quite so "plug it in and it works" to set up, since you'd at least manually need to set up NAT.
The implementation of Access Point mode in some phones isn't great (especially in high noise environments), I've found that Bluetooth PAN mode tends to be more reliable, actually.