Get app name from id #25

Closed
opened 2025-01-02 03:05:52 +01:00 by Benjamin_Loison · 2 comments

DuckDuckGo search ADB get clean app name.

The Stack Overflow question 16650765

DuckDuckGo search *ADB get clean app name*. [The Stack Overflow question 16650765](https://stackoverflow.com/q/16650765)
Author
Owner
Bash script:
APK_FILE_NAME=base.apk
for packageInfo in `adb shell pm list packages -3 -f`
do
    apkFilePath=`echo $packageInfo | rev | cut -f 2- -d '=' | rev | cut -f 2- -d ':'`
    adb pull $apkFilePath > /dev/null
    aapt d badging $APK_FILE_NAME | grep -Po "application-label:'\K(.*)'" | head -c -2
    packageId=`echo $packageInfo | rev | cut -d '=' -f 1 | rev`
    echo " ($packageId)"
    rm $APK_FILE_NAME
done

Source: the Android Stack Exchange answer 188229

<details> <summary>Bash script:</summary> ```bash APK_FILE_NAME=base.apk for packageInfo in `adb shell pm list packages -3 -f` do apkFilePath=`echo $packageInfo | rev | cut -f 2- -d '=' | rev | cut -f 2- -d ':'` adb pull $apkFilePath > /dev/null aapt d badging $APK_FILE_NAME | grep -Po "application-label:'\K(.*)'" | head -c -2 packageId=`echo $packageInfo | rev | cut -d '=' -f 1 | rev` echo " ($packageId)" rm $APK_FILE_NAME done ``` </details> Source: [the Android Stack Exchange answer 188229](https://android.stackexchange.com/a/188229)
Author
Owner
Related to [Benjamin_Loison/Voice_assistant/issues/19](https://codeberg.org/Benjamin_Loison/Voice_assistant/issues/19).
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Loison/adb#25
No description provided.