when I type adb devices
in the shell
I get something like this
List of devices attached
HT06RPQ002T1 device
HT06RPQ002T1 device
I want some shell script that will print just the ids of the phones for example in this case to print
HT06RPQ002T1
HT06RPQ002T1
if more devices are attached to print more ids...
Thanks
EDIT
I tried to put everything in a variable like this
asd=adb devices
but I do not have idea how to parse if I have one device attached or I have 10 devices...
Connected devices are physical objects that can connect with each other and other systems via the internet. They span everything from traditional computing hardware, such as a laptop or desktop, to common mobile devices, such as a smartphone or tablet, to an increasingly wide range of physical devices and objects.
Open your router's mobile app and look for a tab that lists all the devices connected to your network. It might say Devices or Device Manager. If your router doesn't come with a companion app, try a free Wi-Fi analyzer app to monitor connected devices and the security of your network.
adb devices | awk 'NR>1 {print $1}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With