We’re rewarding the question askers & reputations are being recalculated! Read more.
8 replaced http://android.stackexchange.com/ with https://android.stackexchange.com/
source | link
  • Nothing much, except that you need a *nix OS. Cygwin may work for MS-Windows.
  • You won't be seeing labels but only the package names.

    (To get app's label using its package name, use GAThrawn's answeranswer - works if only the app is available in Play Store; use Izzy's answeranswer - works for any installed app.)

  • Nothing much, except that you need a *nix OS. Cygwin may work for MS-Windows.
  • You won't be seeing labels but only the package names.

    (To get app's label using its package name, use GAThrawn's answer - works if only the app is available in Play Store; use Izzy's answer - works for any installed app.)

  • Nothing much, except that you need a *nix OS. Cygwin may work for MS-Windows.
  • You won't be seeing labels but only the package names.

    (To get app's label using its package name, use GAThrawn's answer - works if only the app is available in Play Store; use Izzy's answer - works for any installed app.)

7 added 107 characters in body
source | link
#!/system/bin/sh
# Check if the busybox binary exists under /data/local/tmp/ or /system/xbin. Set the detected binary's path into the variable busybox or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/busybox ]] && busybox=/data/local/tmp/busybox || { [[ -x /system/xbin/busybox ]] && busybox=/system/xbin/busybox || { printfdate "busybox+'busybox binary not found or executable permission is not set. Exiting\n"Exiting' && exit; }; }

# Check if the aapt binary exists under /data/local/tmp or /system/bin or /system/xbin. Set the detected binary's path into the variable aapt or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/aapt ]] && aapt=/data/local/tmp/aapt || { [[ -x /system/bin/aapt ]] && aapt=/system/bin/aapt || { [[ -x /system/xbin/aapt ]] && aapt=/system/xbin/aapt || { printfdate "aapt+'aapt binary not found or executable permission is not set. Exiting\n"Exiting' && exit; }; }; }

! [[ "$1" == +([0-9a-zA-Z._]) ]] && { $busybox printf 'Permission field should not be empty or contain anything beyond these characters: a-zA-Z0-9._' && exit; } || perm=$1;

# List package name of all the installed apps and save them in the file packages.txt under /sdcard
pm list packages | $busybox sed 's/^package://g' | $busybox sort -o /sdcard/packages.txt
$busybox printf "\nList of apps with permission android.permission.CAMERA$perm:\n\n";

# From the output we just saved, take each line (package name) and see whether the package has the said permission. Print the app's label and package name when positive. Before printing everything we're also sorting the lines in A-Za-z order. Sorting is not mandatory.
while read line; do 
    [[ `dumpsys package $line | grep 'android.permission.CAMERA'`"$perm"` ]] && perm=1 || perm=0;
    if [[ $perm == 1 ]]; then
        path=$(pm path $line | $busybox sed 's/^package://g');
        label=$($aapt d badging $path 2>&1 | $busybox sed -ne '/application: label=/p' | $busybox cut -d "'" -f2);
        $busybox printf "$label ($line)\n";
    fi
done < /sdcard/packages.txt | sort

Note: replace highlighted strings with the android permission for which you want to list apps.

adb shell sh /sdcard/perm_script.sh PERMISSION   # replace PERMISSION with the android permission for which apps are to be shown
#!/system/bin/sh
# Check if the busybox binary exists under /data/local/tmp/ or /system/xbin. Set the detected binary's path into the variable busybox or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/busybox ]] && busybox=/data/local/tmp/busybox || { [[ -x /system/xbin/busybox ]] && busybox=/system/xbin/busybox || { printf "busybox binary not found or executable permission is not set. Exiting\n" && exit; }; }

# Check if the aapt binary exists under /data/local/tmp or /system/bin or /system/xbin. Set the detected binary's path into the variable aapt or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/aapt ]] && aapt=/data/local/tmp/aapt || { [[ -x /system/bin/aapt ]] && aapt=/system/bin/aapt || { [[ -x /system/xbin/aapt ]] && aapt=/system/xbin/aapt || { printf "aapt binary not found or executable permission is not set. Exiting\n" && exit; }; }; }

# List package name of all the installed apps and save them in the file packages.txt under /sdcard
pm list packages | $busybox sed 's/^package://g' | $busybox sort -o /sdcard/packages.txt
$busybox printf "\nList of apps with permission android.permission.CAMERA:\n\n";

# From the output we just saved, take each line (package name) and see whether the package has the said permission. Print the app's label and package name when positive. Before printing everything we're also sorting the lines in A-Za-z order. Sorting is not mandatory.
while read line; do 
    [[ `dumpsys package $line | grep 'android.permission.CAMERA'` ]] && perm=1 || perm=0;
    if [[ $perm == 1 ]]; then
        path=$(pm path $line | $busybox sed 's/^package://g');
        label=$($aapt d badging $path 2>&1 | $busybox sed -ne '/application: label=/p' | $busybox cut -d "'" -f2);
        $busybox printf "$label ($line)\n";
    fi
done < /sdcard/packages.txt | sort

Note: replace highlighted strings with the android permission for which you want to list apps.

adb shell sh /sdcard/perm_script.sh
#!/system/bin/sh
# Check if the busybox binary exists under /data/local/tmp/ or /system/xbin. Set the detected binary's path into the variable busybox or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/busybox ]] && busybox=/data/local/tmp/busybox || { [[ -x /system/xbin/busybox ]] && busybox=/system/xbin/busybox || { date +'busybox binary not found or executable permission is not set. Exiting' && exit; }; }

# Check if the aapt binary exists under /data/local/tmp or /system/bin or /system/xbin. Set the detected binary's path into the variable aapt or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/aapt ]] && aapt=/data/local/tmp/aapt || { [[ -x /system/bin/aapt ]] && aapt=/system/bin/aapt || { [[ -x /system/xbin/aapt ]] && aapt=/system/xbin/aapt || { date +'aapt binary not found or executable permission is not set. Exiting' && exit; }; }; }

! [[ "$1" == +([0-9a-zA-Z._]) ]] && { $busybox printf 'Permission field should not be empty or contain anything beyond these characters: a-zA-Z0-9._' && exit; } || perm=$1;

# List package name of all the installed apps and save them in the file packages.txt under /sdcard
pm list packages | $busybox sed 's/^package://g' | $busybox sort -o /sdcard/packages.txt
$busybox printf "\nList of apps with permission $perm:\n\n";

# From the output we just saved, take each line (package name) and see whether the package has the said permission. Print the app's label and package name when positive. Before printing everything we're also sorting the lines in A-Za-z order. Sorting is not mandatory.
while read line; do 
    [[ `dumpsys package $line | grep "$perm"` ]] && perm=1 || perm=0;
    if [[ $perm == 1 ]]; then
        path=$(pm path $line | $busybox sed 's/^package://g');
        label=$($aapt d badging $path 2>&1 | $busybox sed -ne '/application: label=/p' | $busybox cut -d "'" -f2);
        $busybox printf "$label ($line)\n";
    fi
done < /sdcard/packages.txt | sort
adb shell sh /sdcard/perm_script.sh PERMISSION   # replace PERMISSION with the android permission for which apps are to be shown
6 I noticed severe flaws in my earlier version of this answer. Rectified them.
source | link

ShouldIn case, you ever decide to go with a command-line way, you can dotry my approach.

Dependencies

  • Requires to be setup in PC.
  • Requires busybox binary. If the device is rooted, install Busybox app. Else, download busybox binary from official source, rename the binary to busybox, set Linux compatible executable permission on that binary for everyone and move it into device using

    adb push LOCAL_FILE /data/local/tmp/   # LOCAL_FILE is the file path where busybox binary is located in PC
    
  • Requires aapt binary. If you're running a CM or its derivative ROM then ignore this requirement. Otherwise, for Android 4.x, you can consider downloading the binary from here, rename the binary to aapt, set Linux compatible executable permission on that binary for everyone and move it into device using

    adb push LOCAL_FILE /data/local/tmp/   # LOCAL_FILE is the file path where busybox binary is located in PC . 
    

    Android 5.x users: ask Google for assistance.

(Note: you would need a *nix system, adb setup in PC and device connected to it in debugging mode.) This is my little script:

adb#!/system/bin/sh
# shellCheck dumpsysif packagethe |busybox awkbinary -vexists RS='\nunder +Package'/data/local/tmp/ 'or /android\.permission\system/xbin.CAMERA Set the detected binary's path into the variable busybox or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/busybox ]] && busybox=/data/local/tmp/busybox || {print $1[[ -x /system/xbin/busybox ]] && busybox=/system/xbin/busybox || { printf "busybox binary not found or executable permission is not set. Exiting\n" && exit; }'; |}

# sedCheck if the aapt binary exists under /data/local/tmp or /system/bin or /system/xbin. Set the detected binary's path into the variable aapt or exit if file doesn't exist or executable permission is not set
[[ -ex 's/\[data/local/tmp/g'aapt ]] && aapt=/data/local/tmp/aapt || { [[ -ex 's/\]system/bin/g'aapt ]] && aapt=/system/bin/aapt || { [[ -ex /system/xbin/aapt ]] && aapt=/system/xbin/aapt || { printf "aapt binary not found or executable permission is not set. Exiting\n" && exit; }; }; }

# List package name of all the installed apps and save them in the file packages.txt under /sdcard
pm list packages | $busybox sed 's/Verifiers\^package://g' | tail$busybox sort -no +2/sdcard/packages.txt
$busybox |printf tr"\nList of apps with permission android.permission.CAMERA:\n\n";

# From the output we just saved, take each line (package name) and see whether the package has the said permission. Print the app's label and package name when positive. Before printing everything we're also sorting the lines in A-dZa-z '\r'order. |Sorting is not mandatory.
while read line; do adb 
 shell   [[ `dumpsys package $line | grep 'android.permission.CAMERA'` ]] && perm=1 || perm=0;
    if [[ $perm == 1 ]]; then
        path=$(pm path $line | sed$busybox -esed 's/package\^package://g' | tr);
 -d '\r' | xargs -0 adb shell aaptlabel=$($aapt d badging $path 2>&1 | grep$busybox "applicationsed -ne '/application: label"label=/p' | awk$busybox cut -Fd "'" '{print-f2);
        $busybox printf "$label ($2$line)}';\n";
 done;   fi
done < /sdcard/packages.txt | sort
  • dumpsys package: list all the installed packages with their info
  • awk: finds the permission (mentioned in the command) in the output of previous command and list the APK's path corresponding to the permission (originally, by muru)
  • sed, tail and tr: does some cleaning of bits and pieces of last output
  • while and do: while reads each line from the output and do executes the further task. The further task involves passing APK's path to aapt and extract the label of the app from the followed output.
  • xargs: because adb disregards standard input stream so this would help in piping the input

    (I'm using aapt binary for Android, hence used adb shell in prefix. For PC, download Android SDK.)

Note: replace highlighted strings with the android permission for which you want to list apps.

Dummy output ofSave the script in PC into a file named perm_script.sh and move it into /sdcard using

adb push LOCAL_FILE /sdcard/   # LOCAL_FILE is the  path where you saved that file into PC

Run that file

adb shell sh /sdcard/perm_script.sh

The greater the apps installed in the system, the greater the time will be for the command to complete execution. In my device, it took around 40 seconds.

Demo output:

AirDroid
Camera
Elixir
GoogleList Search
DSof Batteryapps Saverwith Pro
GravityBox
Searchpermission Lightandroid.permission.CAMERA:
Barcode Scanner
DroidAirDroid Automation
Google+(com.sand.airdroid)
Android Live Wallpapers (com.android.wallpaper)
WeLineBarcode Scanner (com.google.zxing.client.android)
FreeOTPCamera (com.android.camera2)
MacroDroidCellConnectionService (com.mediatek.CellConnService)
GalleryChrome (com.android.chrome)
Tasker...
Webkey
Mobileuncle Tools
Talk(com.webkey)
SystemYGPS UI(com.mediatek.ygps)
YouTube
Face Unlock
Chrome
Google Play services(com.google.android.youtube)

One-liner

Use this commandYou can reduce the script to remove those apps in bulk one line:

 
adb shell dumpsys package | awk -v RS='\n +Package'pm '/android\.permission\.CAMERA/{printlist $1}'packages | sed -e 's/\[//g'tr -ed 's/\]//g''\r'| -esed 's/Verifiers\package://g' | tailwhile -nread +2line; |do tr[[ -d`adb '\r'shell |dumpsys whilepackage read$line line;| dogrep adb'android.permission.CAMERA'` shell]] pm&& uninstallecho $line;"$line"; done;done

orDrawbacks:

  • Nothing much, except that you need a *nix OS. Cygwin may work for MS-Windows.
  • You won't be seeing labels but only the package names.

    (To get app's label using its package name, use GAThrawn's answer - works if only the app is available in Play Store; use Izzy's answer - works for any installed app.)

Profit: execution time reduced to ~50%


Bulk removal

Use this command to remove those apps in bulk

 
adb shell dumpsyspm packagelist packages | awktr -v RS='\n +Package' '/android\.permission\.CAMERA/{print $1}'d |'\r'| sed -e 's/\[package://g' -e| 's/\]//g'while -eread 's/Verifiers\://g'line; |do tail[[ -n`adb +2shell dumpsys package $line | trgrep -d'android.permission.CAMERA'` '\r']] |&& whileecho read"Removing line;$line" do&& adb uninstall $line; done;done

For Windows users, this answer by Lucky may helpExpect it to report failure for system apps.

For rooted devices specificallyShow App info for all

 
adb shell dumpsys package | awk -v RS='\n +Package'pm '/android\.permission\.CAMERA/{printlist $1}'packages | sed -e 's/\[//g'tr -ed 's/\]//g''\r'| -esed 's/Verifiers\package://g' | tail -n +2 | tr -d '\r' | while read line; do adb shell su -c am start -d "package:$line" -n com.android.settings/.applications.InstalledAppDetails -activity-multiple-task;[[ sleep`adb 1.5;shell done

Alternatively, as the device is rooted, you need not to have a PC to get the things done. You can use a terminal emulator app and use these commands

(adb shell prefix removed, su added to gain superuser privileges)

su
dumpsys package | awk -v$line RS='\n| +Package'grep '/android\'android.permission\permission.CAMERA/{print $1}' | sed -e 's/\[//g' -e 's/\]//g' -e 's/Verifiers\://g'CAMERA'` |]] tail&& -nprintf +2"Launching |App trinfo -dpage '\r'of |$line\n" while&& read line;adb doshell am start -d "package:$line" -n com.android.settings/.applications.InstalledAppDetails --activity-multiple-task;task && sleep 1.5; done 

The command is pretty much similar with the one used in non-root section, except these parts:

  • am: activity manager; launches the Settings app's activity named .applications.InstalledAppDetails here
  • -d: next to it is the data passed to the activity; package name in this case
  • -n: to specify app component
  • -activity-multiple-task: a flag; used it because no other flag suits the purpose
  • sleep: to wait before execution of next set of command; used because Settings apps may crash due to excessive requests in a short span

The flag used here--activity-multiple-task is very important to note. It is because of that every App info page for an app would be shown as a new task for the same activity. In essence, App Info page for every app having the Camera permission can be accessed under the Recent activities and once you close the App Info page of an app using the Back button, the App Info page for an other app would show up because they were consecutively opened. In essence, App Info page for every app having the fed Android permission can be accessed under the Recent activities and once you close the App Info page of an app using the Back button, the App Info page for an other app would show up because they were consecutively opened.

In this way, you can review the app having the Camera permission and take the actions on it, be it Uninstall or Disable.


Root only: If you've Tasker installed, you can have it to show notification for each of the app having the said permission and each notification can be made to open an App info page.

Try it because that's fun and very easy to do!

Should you ever decide to go with a command-line way, you can do

(Note: you would need a *nix system, adb setup in PC and device connected to it in debugging mode.)

adb shell dumpsys package | awk -v RS='\n +Package' '/android\.permission\.CAMERA/{print $1}' | sed -e 's/\[//g' -e 's/\]//g' -e 's/Verifiers\://g' | tail -n +2 | tr -d '\r' | while read line; do adb shell pm path $line | sed -e 's/package\://g' | tr -d '\r' | xargs -0 adb shell aapt d badging | grep "application: label" | awk -F "'" '{print($2)}'; done;
  • dumpsys package: list all the installed packages with their info
  • awk: finds the permission (mentioned in the command) in the output of previous command and list the APK's path corresponding to the permission (originally, by muru)
  • sed, tail and tr: does some cleaning of bits and pieces of last output
  • while and do: while reads each line from the output and do executes the further task. The further task involves passing APK's path to aapt and extract the label of the app from the followed output.
  • xargs: because adb disregards standard input stream so this would help in piping the input

    (I'm using aapt binary for Android, hence used adb shell in prefix. For PC, download Android SDK.)

Dummy output of the command

AirDroid
Camera
Elixir
Google Search
DS Battery Saver Pro
GravityBox
Search Light
Barcode Scanner
Droid Automation
Google+
Android Live Wallpapers
WeLine
FreeOTP
MacroDroid
Gallery
Tasker
Webkey
Mobileuncle Tools
Talk
System UI
YouTube
Face Unlock
Chrome
Google Play services

Use this command to remove those apps in bulk

adb shell dumpsys package | awk -v RS='\n +Package' '/android\.permission\.CAMERA/{print $1}' | sed -e 's/\[//g' -e 's/\]//g' -e 's/Verifiers\://g' | tail -n +2 | tr -d '\r' | while read line; do adb shell pm uninstall $line; done;

or

adb shell dumpsys package | awk -v RS='\n +Package' '/android\.permission\.CAMERA/{print $1}' | sed -e 's/\[//g' -e 's/\]//g' -e 's/Verifiers\://g' | tail -n +2 | tr -d '\r' | while read line; do adb uninstall $line; done;

For Windows users, this answer by Lucky may help.

For rooted devices specifically

adb shell dumpsys package | awk -v RS='\n +Package' '/android\.permission\.CAMERA/{print $1}' | sed -e 's/\[//g' -e 's/\]//g' -e 's/Verifiers\://g' | tail -n +2 | tr -d '\r' | while read line; do adb shell su -c am start -d "package:$line" -n com.android.settings/.applications.InstalledAppDetails -activity-multiple-task; sleep 1.5; done

Alternatively, as the device is rooted, you need not to have a PC to get the things done. You can use a terminal emulator app and use these commands

(adb shell prefix removed, su added to gain superuser privileges)

su
dumpsys package | awk -v RS='\n +Package' '/android\.permission\.CAMERA/{print $1}' | sed -e 's/\[//g' -e 's/\]//g' -e 's/Verifiers\://g' | tail -n +2 | tr -d '\r' | while read line; do am start -d "package:$line" -n com.android.settings/.applications.InstalledAppDetails --activity-multiple-task; sleep 1.5; done

The command is pretty much similar with the one used in non-root section, except these parts:

  • am: activity manager; launches the Settings app's activity named .applications.InstalledAppDetails here
  • -d: next to it is the data passed to the activity; package name in this case
  • -n: to specify app component
  • -activity-multiple-task: a flag; used it because no other flag suits the purpose
  • sleep: to wait before execution of next set of command; used because Settings apps may crash due to excessive requests in a short span

The flag used here is very important. It is because of that every App info page for an app would be shown as a new task for the same activity. In essence, App Info page for every app having the Camera permission can be accessed under the Recent activities and once you close the App Info page of an app using the Back button, the App Info page for an other app would show up because they were consecutively opened.

In this way, you can review the app having the Camera permission and take the actions on it, be it Uninstall or Disable.


Root only: If you've Tasker installed, you can have it to show notification for each of the app having the said permission and each notification can be made to open an App info page.

Try it because that's fun and very easy to do!

In case, you ever decide to go with a command-line way, you can try my approach.

Dependencies

  • Requires to be setup in PC.
  • Requires busybox binary. If the device is rooted, install Busybox app. Else, download busybox binary from official source, rename the binary to busybox, set Linux compatible executable permission on that binary for everyone and move it into device using

    adb push LOCAL_FILE /data/local/tmp/   # LOCAL_FILE is the file path where busybox binary is located in PC
    
  • Requires aapt binary. If you're running a CM or its derivative ROM then ignore this requirement. Otherwise, for Android 4.x, you can consider downloading the binary from here, rename the binary to aapt, set Linux compatible executable permission on that binary for everyone and move it into device using

    adb push LOCAL_FILE /data/local/tmp/   # LOCAL_FILE is the file path where busybox binary is located in PC . 
    

    Android 5.x users: ask Google for assistance.

This is my little script:

#!/system/bin/sh
# Check if the busybox binary exists under /data/local/tmp/ or /system/xbin. Set the detected binary's path into the variable busybox or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/busybox ]] && busybox=/data/local/tmp/busybox || { [[ -x /system/xbin/busybox ]] && busybox=/system/xbin/busybox || { printf "busybox binary not found or executable permission is not set. Exiting\n" && exit; }; }

# Check if the aapt binary exists under /data/local/tmp or /system/bin or /system/xbin. Set the detected binary's path into the variable aapt or exit if file doesn't exist or executable permission is not set
[[ -x /data/local/tmp/aapt ]] && aapt=/data/local/tmp/aapt || { [[ -x /system/bin/aapt ]] && aapt=/system/bin/aapt || { [[ -x /system/xbin/aapt ]] && aapt=/system/xbin/aapt || { printf "aapt binary not found or executable permission is not set. Exiting\n" && exit; }; }; }

# List package name of all the installed apps and save them in the file packages.txt under /sdcard
pm list packages | $busybox sed 's/^package://g' | $busybox sort -o /sdcard/packages.txt
$busybox printf "\nList of apps with permission android.permission.CAMERA:\n\n";

# From the output we just saved, take each line (package name) and see whether the package has the said permission. Print the app's label and package name when positive. Before printing everything we're also sorting the lines in A-Za-z order. Sorting is not mandatory.
while read line; do  
    [[ `dumpsys package $line | grep 'android.permission.CAMERA'` ]] && perm=1 || perm=0;
    if [[ $perm == 1 ]]; then
        path=$(pm path $line | $busybox sed 's/^package://g');
        label=$($aapt d badging $path 2>&1 | $busybox sed -ne '/application: label=/p' | $busybox cut -d "'" -f2);
        $busybox printf "$label ($line)\n";
    fi
done < /sdcard/packages.txt | sort

Note: replace highlighted strings with the android permission for which you want to list apps.

Save the script in PC into a file named perm_script.sh and move it into /sdcard using

adb push LOCAL_FILE /sdcard/   # LOCAL_FILE is the  path where you saved that file into PC

Run that file

adb shell sh /sdcard/perm_script.sh

The greater the apps installed in the system, the greater the time will be for the command to complete execution. In my device, it took around 40 seconds.

Demo output:

List of apps with permission android.permission.CAMERA:

AirDroid (com.sand.airdroid)
Android Live Wallpapers (com.android.wallpaper)
Barcode Scanner (com.google.zxing.client.android)
Camera (com.android.camera2)
CellConnectionService (com.mediatek.CellConnService)
Chrome (com.android.chrome)
...
Webkey (com.webkey)
YGPS (com.mediatek.ygps)
YouTube (com.google.android.youtube)

One-liner

You can reduce the script to one line:

 
adb shell pm list packages | tr -d '\r'| sed 's/package://g' | while read line; do [[ `adb shell dumpsys package $line | grep 'android.permission.CAMERA'` ]] && echo "$line"; done

Drawbacks:

  • Nothing much, except that you need a *nix OS. Cygwin may work for MS-Windows.
  • You won't be seeing labels but only the package names.

    (To get app's label using its package name, use GAThrawn's answer - works if only the app is available in Play Store; use Izzy's answer - works for any installed app.)

Profit: execution time reduced to ~50%


Bulk removal

Use this command to remove those apps in bulk

 
adb shell pm list packages | tr -d '\r'| sed 's/package://g' | while read line; do [[ `adb shell dumpsys package $line | grep 'android.permission.CAMERA'` ]] && echo "Removing $line" && adb uninstall $line; done

Expect it to report failure for system apps.

Show App info for all

 
adb shell pm list packages | tr -d '\r'| sed 's/package://g' | while read line; do [[ `adb shell dumpsys package $line | grep 'android.permission.CAMERA'` ]] && printf "Launching App info page of $line\n" &&  adb shell am start -d "package:$line" -n com.android.settings/.applications.InstalledAppDetails --activity-multiple-task && sleep 1.5; done 

The flag --activity-multiple-task is important to note. It is because of that every App info page for an app would be shown as a new task for the same activity. In essence, App Info page for every app having the fed Android permission can be accessed under the Recent activities and once you close the App Info page of an app using the Back button, the App Info page for an other app would show up because they were consecutively opened.

In this way, you can review the app having the Camera permission and take the actions on it, be it Uninstall or Disable.

5 added 2617 characters in body
source | link
4 edited the commands
source | link
3 added 108 characters in body
source | link
2 added 616 characters in body
source | link
1
source | link