adb 列出用户当前运行用户 ID
# 返回当前用户 id
.\adb.exe shell am get-current-user
.\adb.exe shell cmd activity get-current-user      # alternative command 
 .\adb.exe shell 'dumpsys activity | grep mCurrentUser'

 # 当前用户的详细信息
 .\adb.exe shell dumpsys user

 #  列出所有用户
  .\adb.exe shell pm list users

 # 列出当前运行的 activity , 其中有对应用户信息
 adb shell dumpsys activity

https://android.stackexchange.com/questions/103824/how-to-find-out-currently-running-user-name-id-from-adb

上一篇
下一篇