pidcat
pidcat copied to clipboard
Getting package list with "ls /data/data" not working on recent Android versions
I'm not getting autocompletion for package names with Android 12 emulator.
The reason is that this command fails:
adb $device_selected shell ls /data/data 2>/dev/null
because of a permissions issue:
adb shell ls /data/data
ls: /data/data: Permission denied
This replacement works fine for me:
local apks=$(adb $device_selected shell pm list packages 2>/dev/null | sed "s/package://g" | tr '\n' ' ' | tr -d '\r')
I had no idea the completions were using that method. They were both contributed code. Obviously going through the package manager is the right way.