• Stars
    star
    2,975
  • Rank 15,206 (Top 0.3 %)
  • Language
    C++
  • License
    Other
  • Created about 12 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android USB tethering driver for Mac OS X

HoRNDIS(the USB tethering driver for Mac OS X)

HoRNDIS (pronounce: "horrendous") is a driver for Mac OS X that allows you to use your Android phone's native USB tethering mode to get Internet access.

For more information, visit the home page for HoRNDIS on my site.

Installation

From Source/Binary

  • Get the installation package (Download or Build the installation package from source yourself)
  • Run the installation package

From Homebrew

brew cask install horndis
sudo kextload /Library/Extensions/HoRNDIS.kext

Configuration

  • Assuming that the installation proceeds without errors, after it completes, connect your phone to your Mac by USB.
  • Enter the settings menu on your phone.
  • In the connections section, below Wi-Fi and Bluetooth:
    • Select "More..."
    • Select "Tethering & portable hotspot"
  • Check the "USB tethering" box. It should flash once, and then become solidly checked.

Uninstallation

  • Delete the HoRNDIS.kext under /System/Library/Extensions and /Library/Extensions folder
  • Restart your computer

Building the source

  • git clone the repository
  • Simply running xcodebuild in the checkout directory should be sufficient to build the kext.
  • If you wish to package it up, you can run make to assemble the package in the build/ directory

Debugging and Development Notes

This sections contains tips and tricks for developing and debugging the driver.

USB Device Information

Mac OS System Menu -> About This Mac -> System Report --> Hardware/USB
Lists all USB devices that OS recognizes. Unfortunately, it does not give USB descriptors.

lsusb -v
It prints USB configuration, such as interface and endpoint descriptors. You can print it for all devices or limit the output to specific ones. In order to run this command, you need to install usbutils.

  • Homebrew users: brew install mikhailai/misc/usbutils
    Please do not install lsusb package from Homebrew Core, it's a different utility with the same name.
  • Macports users: sudo port install usbutils

IO Registry

ioreg -l -r -c IOUSBHostDevice
This command lists all the Mac OS IO Registry information under all USB devices. Unlike lsusb, ioreg tells how Mac OS recognized USB devices and interfaces, and how it matched drivers to these interfaces. The -r -c IOUSBHostDevice limits the output to USB devices; to get complete OS registry, please run ioreg -l.

OS Logging

The LOG(....) statements, sprinkled throughout the HoRNDIS code, call the IOLog functions. On Mac OS El Capitan (10.11) and earlier, the log messages go into /var/log/system.log. Starting from Sierra (10.12), these messages are no longer written to system.log and instead can be viewed via:

  • GUI, using Console application, located in Utilities folder. You need to enter process:kernel in the search box in order to filter the relevant messages.
  • Command Line, using the log command. For example:
    log show --predicate process==\"kernel\" --start "2018-12-11 22:54:00"
    The start value needs to be several minutes in the past, so it would not flood the console. Here is a convenient command that prints the messages from the past 3 mintes:
    log show --predicate process==\"kernel\" --start "$(date -v-3M +'%F %T')"

I've observed that Mac OS logging is unreliable (especially in Sierra). In some cases, the messages may come out garbled (looking like bad multi-threaded code). In other cases, either GUI or Command Line may be missing messages that were emitted. Sometimes, reloading the driver may fix the problem.

More Repositories

1

28c3-doctorow

Transcription of Cory Doctorow's keynote from 28C3.
110
star
2

pyusbip

Userspace USBIP server (i.e., "shares a USB device") implementation based on python-libusb1
Python
62
star
3

netwatch

NetWatch System Management Mode VNC Server
C
30
star
4

ndfslave

Tools to pull data off of a NAND flash chip using a Digilent Nexys-2 board.
C
29
star
5

aWatch2-hw

hardware for aWatch2
18
star
6

mods-driver

MODS kernel driver
C
9
star
7

x1-expander

Expander board for Bambu Lab X1 Carbon
Python
9
star
8

gpsrenda

Cairo-based fit file video overlay renderer
Python
8
star
9

naim

naim is a console client for AOL Instant Messenger (AIM), AOL I Seek You (ICQ), Internet Relay Chat (IRC), and The lily CMC.
C
8
star
10

aoc

Advent of Bad Code
Lua
6
star
11

dumload

A small image uploader for Android accessible by 'Share' (or, how not to write Android code).
Java
6
star
12

rlambda

Small lambda calculus interpreter in Rust
Rust
5
star
13

dvbt

A scratch space for playing with DVB-T signals
C
5
star
14

naim-oscar

OSCAR support for naim, written in Lua.
Lua
4
star
15

minilib

A small C library that one might wish to plop down in bare-metal projects.
C
4
star
16

rustfftw

libFFTW bindings for Rust.
Rust
4
star
17

e3tools

Utilities to make sense out of really damaged ext2/ext3 filesystems (and even working ones, too!).
C
4
star
18

pebble-idbs

4
star
19

ipaq-debrick

Old tools to debrick old devices.
C
4
star
20

gpp-hax

experimental resources for messing with a GPP4323
C
3
star
21

tdl

Joshua's patches to Richard Curnow's To Do List tracker
C
3
star
22

ufpgapll

little FPGA PLL
Verilog
3
star
23

lightbox

A tiny little web album generator.
Shell
2
star
24

snow

A programmatic interface to snow reports
Python
2
star
25

pebble-epicmix

An EpicMix client for Pebble (see your vertical feet without pulling out your phone!)
JavaScript
2
star
26

vterm

Serial terminal emulator on a Nexys-2 development board (Spartan 3)
Verilog
2
star
27

hlife

some hacks on Tomas Rokicki's hlife
C
1
star
28

e3lua

e3tools, except with more Lua
Lua
1
star
29

xvmouse

A little application to let you control your mouse with your keyboard
C
1
star
30

dnairc-bridge

bridge between dnairc.js and real honest to god IRC
Python
1
star
31

libmpdclient

libmpdclient
C
1
star
32

rust-packages

My Rust packages.
1
star
33

tsheets-py

QuickBooks Time / TSheets command line API client
Python
1
star
34

dalipebble

An xdaliclock port to Pebble.
C
1
star
35

hrm-cam-linux

heart rate monitor overlay for v4l2 webcams
Python
1
star
36

c5g-basecode

Base code for Terasic C5G (Altera 5CGXFC5C6F27C7), with Makefile
Verilog
1
star
37

patchfork

Patchfork web MPD client (fork of Pitchfork)
Java
1
star
38

musicpd

patches to mpd
C++
1
star
39

x1plusweb

React interface for X1Plus httpd
TypeScript
1
star