获取附加设备列表

Luk*_*kap 7 linux bash shell android

当我输入adb devicesshell时,我会得到类似的东西

List of devices attached 
HT06RPQ002T1    device
HT06RPQ002T1    device
Run Code Online (Sandbox Code Playgroud)

我想要一些shell脚本,只打印电话的ID,例如在这种情况下打印

HT06RPQ002T1
HT06RPQ002T1
Run Code Online (Sandbox Code Playgroud)

如果连接更多设备打印更多的ID ...

谢谢

编辑

我试图将所有内容放在像这样的变量asd = adb devices 但是如果我连接了一台设备或者我有10台设备,我不知道如何解析...

aph*_*hex 12

adb devices | awk 'NR>1 {print $1}'
Run Code Online (Sandbox Code Playgroud)