#!/bin/bash
adb devices 2>&1|grep '-'|awk '{print $1}'|awk -F- '{print $2}'

 

简单的shell将所有android devices列出来,寻找所有端口

List of devices attached
10.32.11.77-5554 device
10.32.11.77-5556 device
10.32.11.77-5558 device
10.32.11.77-5560 device
10.32.11.77-5562 device
10.32.11.77-5564 device
10.32.11.77-5566 device
10.32.11.77-5568 device
10.32.11.77-5570 device

----------------------

结果:

5554
5556
5558
5560
5562
5564
5566
5568
5570

posted on 2012-09-13 14:04  Rik~  阅读(1113)  评论(0编辑  收藏  举报