'ADB'에 해당되는 글 2건

  1. 2011.06.08 Android Usb Port Forwarding (1)
  2. 2010.11.11 Android Packet Sniffer Android-Arts
2011. 6. 8. 20:33

Android Usb Port Forwarding


The Android architecture does not allow to start communication from the Android to the host through the USB cable.The opposite is possible, using the Google "Android Debug Bridge" (ADB in short).    

This tool will act as a tunnel between the Android client application and the host server. It is a software implementation of a router doing IP port forwarding.

On the Host part, you have to declare the ports you want to be opened on the Android and the tunnel will transfer communications between the android and the host. The host can be any server on the network or your local host. 


  • Enable "Usb debuging" on your Android
  • Install "Usb Tunnel" on your Android (see donwnload link on top of the article) or from the market :
  • Screenshot - market.jpg
  • Install the host windows application (see download link on top of the article) or this skydrive link or this GDoc link   
  • On the configuration panel, enter the path to the ADB program. ADB is part of the Android SDK. The installation includes the minimum files required.
  • Add tunnels. Each tunnel is composed of a name, an Android port (low port like 80 can't be used), a host IP and a host port (can be different from the android port)  

HTTP proxy 

If Tethering is a technology that allows you to use the mobile internet connection on your PC, this tool gives you the opposite. It's a sort of Reverse Tethering.   

You can now surf on your mobile (using the internet connection on your PC) through the Usb tunnel and via a proxy. 

If you are on a company network, ask your administrator what IP adddress and port he is using for the proxy. In some cases it can be the default gateway (run ipconfig command at the DOS prompt to find out what the default gateway is). 

If you are on a private network and you have no clue about the proxy adress and port, you can use a public proxy (do search for "Public proxy" on the internet). To help you out, here is link to a list of proxies. 

Another possibility is to install a local http proxy server like squid.  

Step 1 : configure the windows part. Since low ports can't be used, you should use a different high port for the android and another port for the host.  

Sample configuration for a company network : (192.168.xxx.xxx) on port 80 

Sample configuration for a public internet proxy on port 8080 

Step 2 : Connect he USB cable (of course).  Click the refresh button to display your device in the device list then click connect. The Android Usb tunnel service will start in the background. A connection icon will be added on the notification pannel.  

Step 3 : Setup your browser to use a proxy. Depending on the version of your Android OS, it's possible to define a http proxy in the advanced wifi settings menu (Not tested, available in Android 2.2). 

If you don't want to change the proxy each time (or have an older Android), it's perhaps better to install another browser that lets you specify a proxy.  

I tested it with Opera mobile ( Here is an article with some screenshots) :  

  • Enter about:config in the address bar 
  • Expand the proxy line  
  • Enter in the HTTP server and HTTPS server text box 
  • Click "Save" 

It may work with Firefox (not tested). I didn't find any information for proxy settings for skyfire 

Step 4 : Enjoy! enter any URL on your browser. Your firewall may detect that AndroidTool.exe is trying to access the internet. Give him the rights to access the proxy. 

In this screenshot, you can see the number of active connections , closed connections, total bytes transfered (to and from) 

I checked with an internet speed test. It's just a little bit slower. 


May 2011 : First version 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author
Thierry Parent

Trackback 0 Comment 1
  1. 2011.06.08 20:36 address edit & del reply


2010. 11. 11. 19:32

Android Packet Sniffer Android-Arts

Android packet sniffer is an app which allows to capture and display WIFI, and Bluetooth traffic
on the android phone.
You have to be root on your phone, and have the "su" command installed.
App Install process:
This app is based on the tcpdump package therefor it have to be installed manually.

1. Download and Install PacketSniffer App from the market or from the following direct link.
2. Copy the precompiled TCPDUMP file to the "\data"  library on your phone:    
            -    first make sure your "/data" library has READ and WRITE privileges. if not use:  "chmod 777 data" 
            -    in order to copy use the following command if you have ADB :"adb push c:\locationOfTheTcpdumpFile \data"
            -    in case you don't have ADB you can copy the tcpdump file to the SD card and do:  "cat /sdcard/tcpdump > /data/tcpdump 
3. Give the tcpdump file Read Write and Exec privileges :    "chmod 777 \data\tcpdump"
Thats it you are ready to go.

The main layout of the app allows you to initiate a Wifi or a Bluetooth wireless traffic capture service.
It means that you can close the app and the capture will still continue, until you deactivate it.
Before you start to capture you can pick weather to save the captured data on a local SQL DB on the device
or on to a file on the SD card.

When you had enough data captured, you can use the Statistic Analysis or the Statistic Advanced layouts
to analyse the data you have captured by performing various searches on the packets.

Here are few examples of packets captured by the application:

If you have any suggestions or remarks regarding the application
feel free to contact me via mail:   vadimnetworks@gmail.com
or leave a remark on the android market.

If you appreciate our work and want to support future developments, you are welcome to place a donation.

출처 : http://sites.google.com/site/androidarts

Trackback 0 Comment 0