We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0768c1 commit bd35462Copy full SHA for bd35462
shell/device-tools/DisplayLogcat.sh
@@ -46,7 +46,11 @@ displayLogcatSingleDevice() {
46
if [[ -z ${packageName} ]]; then
47
adb -s "${deviceId}" logcat < /dev/null
48
else
49
- uid=$(adb -s "${deviceId}" shell am getuid -n "${packageName}" 2>/dev/null | cut -d: -f2 | xargs)
+ local uid
50
+ if (( $(getAndroidVersionCodeByAdb "${deviceId}") >= 26 )); then
51
+ uid=$(adb -s "${deviceId}" shell pm list packages -U < /dev/null 2>/dev/null | grep "${packageName}" | awk -F 'uid:' '{print $2}')
52
+ fi
53
+
54
if [[ -z "${uid}" || ! "${uid}" =~ ^[0-9]+$ ]]; then
55
uid=$(adb -s "${deviceId}" shell dumpsys package "${packageName}" < /dev/null 2>/dev/null | awk -F'=' '/userId/{print $2; exit}' | awk '{print $1}' | tr -d '\r')
56
fi
0 commit comments