Skip to content

Instantly share code, notes, and snippets.

@CBike
Last active October 11, 2022 07:20
Show Gist options
  • Save CBike/ccf736da9914fb396018c8400656db1d to your computer and use it in GitHub Desktop.
Save CBike/ccf736da9914fb396018c8400656db1d to your computer and use it in GitHub Desktop.
android devices`s serial number string handling
import subprocess
android_list = []
rsi_id = ''
fpi_id = ''
ret = subprocess.check_output('adb devices', shell=True, universal_newlines=True)
ret = ret.replace('\r', '')
devices = ret.split('\n')
for i in devices:
if i.find('\tdevice') != -1:
i = i.replace('\tdevice','')
android_list.append(i)
print(i)
print (devices)
print (android_list)
print("HELLO C-Bike")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment