JakeWharton / JakeWharton/pidcat

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

Open
#181 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5k
Forks
517
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Search the package-name autocompletion code for the `/data/data` command and trace how its output becomes the package list. Reproduce the failure on an Android 12 emulator, then verify that package-name completion works using the `pm list packages` output without exposing permission errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, python
Domain
cli, mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.