how to echo out this list after the adb command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
goodywp
Posts: 250
Joined: 31 Jul 2017 09:57

how to echo out this list after the adb command

#1 Post by goodywp » 14 Apr 2022 11:42

Hi All,
In Android project, adb is a much intensively used command. Now I have this command as below

Code: Select all

adb devices -l
Output is a list as below
List of devices attached
20ACCD801803 device product:DX8000 model:DX8000 device:DX8000 transport_id:1
2158CD823377 device product:DX8000 model:DX8000 device:DX8000 transport_id:3

Now my question is how to output the above list into a text file so that I can use it as a variable later. The reason for this is that the transport_id is dynamically changing after reboot, either from PC or a device.
So in case the PC or device reboot, I need a new variable for the transport_id so that I can use it for the next connection step to this particular device.

Any thoughts?

Thanks

goodywp
Posts: 250
Joined: 31 Jul 2017 09:57

Re: how to echo out this list after the adb command

#2 Post by goodywp » 14 Apr 2022 11:54

Sorry I just found out it should use below to get output

Code: Select all

adb devices -l >>devicename.txt
and works

Post Reply