Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kmansoft opened this issue May 25, 2022 · 1 comment

Comments

@kmansoft
Copy link

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')
@JakeWharton
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants