Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Is there a way, on a non-rooted Android device, to see a list of what apps are listening on what port? Or even a way to see if an app is listening on a specific port?

share|improve this question
    
Can you nmap from different computer? –  roxan Jun 12 '12 at 3:54
    
@roxan The problem with that is I need to know specifically what app is using a port. I've written 5 apps that all listen on the same port and somewhere somehow one of them isn't closing it and I need to know which one(s). –  nick Jun 12 '12 at 16:16

1 Answer 1

up vote 13 down vote accepted

I was able to see which app had an open port using standard linux knowledge.

Install terminal emulator or do an adb shell and execute the following:

shell@android:/ $ cat /proc/net/tcp
sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
0: 0100007F:1C23 00000000:0000 0A 00000000:00000000 00:00000000 00000000 1001 0 2111 1 e22cc000 300 0 0 2 -1

The important stuff above is:

  • 0100007F:1C23 listen IP-address:port in hex notation, here 127.0.0.1:7203
  • 00000000:0000 remote address empty (listening)
  • 1001 uid of the app

You can map the uid list to apps via How to know app name by UID

share|improve this answer
1  
+1 - thanks for the breakdown, this is very helpful! –  Mr. Buster Aug 28 '12 at 18:22
    
Hovewer, it not list all applications. I scan my device on wifi - it has 2 open ports, but in that file there is no rows, which correspond to that ports. –  Alexey Apr 9 at 12:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.