mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
AndroidTarget: Added android_id property
Get the device's ANDROID_ID. Which is "A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device."
This commit is contained in:
parent
be8f972f60
commit
cafeb81b83
@ -643,6 +643,21 @@ class AndroidTarget(Target):
|
||||
def adb_name(self):
|
||||
return self.conn.device
|
||||
|
||||
@property
|
||||
def android_id(self):
|
||||
"""
|
||||
Get the device's ANDROID_ID. Which is
|
||||
|
||||
"A 64-bit number (as a hex string) that is randomly generated when the user
|
||||
first sets up the device and should remain constant for the lifetime of the
|
||||
user's device."
|
||||
|
||||
.. note:: This will get reset on userdata erasure.
|
||||
|
||||
"""
|
||||
output = self.execute('content query --uri content://settings/secure --projection value --where "name=\'android_id\'"').strip()
|
||||
return output.split('value=')[-1]
|
||||
|
||||
@property
|
||||
@memoized
|
||||
def screen_resolution(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user