adb & netcat example

This guide assumes you have a remote server, called hetty.webconverger.org that you are going to use to avoid any firewall issues.

First make sure you have netcat-openbsd and NOT netcat traditional installed.

sudo apt-get install netcat-openbsd

Then to ensure your system is working try the following basic netcat tip.

Now to share my Android logging output I run on my laptop:

adb logcat | ssh hetty "nc -v -l 8000"

Now to share my log with a remote collegue, he simply runs:

curl http://hetty.webconverger.org:8000

or http://hetty.webconverger.org:8000 in a browser

Now this is a simple connection and it has several problems:

  • It can't be shared, only one person can view the external stream. You can view your logs by running adb logcat again
  • Once the connection has been quit, it closes and adb logcat | ssh hetty "nc -v -l 8000" needs to be restarted
  • The way ports free up, can be a little slow, so restarting the nc process may fail initially, so do re-try
Feedback

Powered by Vanilla PHP feedback form