Skip to content

Getting package list with "ls /data/data" not working on recent Android versions #181

@kmansoft

Description

@kmansoft

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions