Skip to content

Instantly share code, notes, and snippets.

@lattice0
Last active September 26, 2020 07:42
Show Gist options
  • Save lattice0/3ac989bfd57f753793dd6d19a0809e59 to your computer and use it in GitHub Desktop.
Save lattice0/3ac989bfd57f753793dd6d19a0809e59 to your computer and use it in GitHub Desktop.
socat android studio tunnel
Install socat on host and vm
#on virtual machine:
#socat tcp-listen:5037,bind=localhost,reuseaddr,fork tcp:192.168.122.1:5037
#automatic installation on startup:
echo -e '#!/bin/bash\nsocat tcp-listen:5037,bind=localhost,reuseaddr,fork tcp:192.168.122.1:5037 &' | sudo tee --append /etc/rc.local && sudo chmod 755 /etc/rc.local
#on host machine, use with ./script.sh 99 for example
socat tcp-listen:5037,bind=192.168.122.1,reuseaddr,fork tcp:localhost:5037 & socat tcp-listen:19000,bind=localhost,reuseaddr,fork tcp:192.168.122.$1:19000 &
#Then
~/Android/Sdk/platform-tools/adb devices
#on VIRTUAL machine, start adb server. Not required, just to test if things are working. You should see your emulator device
~/Android/Sdk/platform-tools/adb devices
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment