This was WAY simpler than I thought it was. I was trying to get this working for days now but it's actually really simple.
My first approach was using reverse tethering, having the idea that I would need the Android device to get its Internet/LAN connection from the PC and not the other way around.
Though that is not the case, just enable USB Tethering on your android device and thats all you need.
After you did that, open a terminal emulator window on the device or open an adb shell session with the command adb shell
. Enter netcfg
to print out all the IPs and look for a device named rndis0
or usb0
or maybe another name, depending on your ROM or device. Simply look at all the devices that are "UP" and make sure its not Wifi or Mobile data connection, you can recognize them by the device name.
If you think you found the correct adapter (it shouldn't show more than 2-3 devices that are listed as UP
and have an valid IP next to it) simply send your OSC messages to that IP adress and it will work just fine. This should work with about any network protocol.
You should be able to access the device over another computer aswell by setting up some port forwarding on the host PC to the android device IP and sending your messages to the PCs IP. Or maybe using the Android IP adress works aswell though I somewhat doubt your Router is aware of the device.
Double check the IP if its not working, it will not be the same sub network as your LAN. I made that mistake with my first try and blindly entered the first 3 number blocks without having a closer look.