How to collect all Android device ids in bash script
Опубликовано ср, 04/03/2019 - 09:29 пользователем MaximHello everyone!
Today I'm going on to share bash script with you, which will help you to collect all android devices id.
deviceList=""
for line in `adb devices | grep -v "List" | awk '{print $1}'`
do
device=`echo $line | awk '{print $1}'`
echo "$device"
if [ $deviceList != "" ]; then
deviceList="$deviceList,"
fi
deviceList="$devicList$device"
done
echo $deviceList
This approach you can use to capture any data from any output.
Have a good day!
Enjoy!