APK Downloader
·5 min read

Recover a Deleted APK File: What Actually Works and What Doesn't

Cleaning apps delete installer files, or you wiped a folder before backing it up. Unlike photos, an APK is reproducible — which changes the recovery strategy entirely. Split by installed vs not-installed and internal vs removable storage, with adb pull, re-download plus signature verification, and the cases where recovery software is pointless.

androidapkrecoveryadbtroubleshootinggptoapk

Start with the reassuring part: an APK is the least alarming file you can lose. A deleted photo is gone forever. A deleted APK can be obtained again, byte-for-byte, as long as the app is still published and the version still exists somewhere.

The genuinely hard cases are narrower: the file was deleted and the app was never installed, or you need a specific old version that has since been taken down. Everything else has a clean path.

Three situations, three plans

SituationWhat you actually needRecommended path
App is installed, you just want a backup of the installerExtract the package from the deviceadb pull — always works
App not installed, file deletedGet the same or a newer build againOfficial source or mirror, then verify
You need a specific delisted versionLocate an archived buildTrusted archive, then check the signature

The instinct for most people is to install a data-recovery app and scan the phone for deleted .apk files. On modern Android that basically does not work: internal flash has TRIM/discard enabled, so deleted blocks are actively reclaimed. Recovery tools typically scan and find zeros. Recovery software is worth trying only on SD cards or computer drives that are not sending discard commands, and even then only if you stop writing immediately.

Path 1: Pull the package from the device

This is the only path that depends on nothing external. Even if the installer file is long gone, the system still holds /data/app/.../base.apk for any installed app.

# 1. Find the package name
adb shell pm list packages | grep something

# 2. Get its real path
adb shell pm path com.example.app
# package:/data/app/~~aBcD==/com.example.app-xYz==/base.apk

# 3. Pull it
adb pull /data/app/~~aBcD==/com.example.app-xYz==/base.apk ./example.apk

Apps installed as split APKs (App Bundles) report multiple package: lines. Pull the whole directory instead:

adb pull /data/app/~~aBcD==/com.example.app-xYz==/ ./example-splits/

Reinstalling those requires install-multiple:

adb install-multiple ./example-splits/*.apk

Before you archive the extracted file as your precious backup, confirm it is sane:

aapt dump badging example.apk | head -3
apksigner verify --print-certs example.apk | head -5

Path 2: Re-download, then compare against a known fingerprint

If you know the version (or can read it from another device that still has the app), re-downloading is fastest. The essential part is verification, otherwise your "recovery" may be a repackaged build.

# Read the real version from a device that still has it
adb shell dumpsys package com.example.app | grep versionName

# After downloading, verify
shasum -a 256 example.apk
apksigner verify example.apk && echo "signature ok"

apksigner verify passing only means the package's self-signature is internally consistent — not that it came from the official publisher. To check publisher identity, compare certificate digests:

apksigner verify --print-certs example.apk | grep SHA-256

Compare against the digest of a package pulled from a known-good device. Skipping this step is how people end up with a same-name, same-version package signed by someone else — at best it refuses to update over the existing install, at worst it is malware.

Path 3: Delisted versions, three things to check

Once a version is removed from official channels, your sources are archives and third-party version repositories. When picking one, check three things:

  1. Exact version match — do not accept a "latest" label on a listing page.
  2. Plausible file size — a package 3x larger or 90% smaller than expected is a red flag.
  3. Matching signing certificate — the only hard requirement.
apksigner verify --print-certs old-version.apk | grep -i "SHA-256"

If no official copy exists to compare against, fall back to behavioral checks: it installs cleanly, its requested permissions in adb shell dumpsys package match what the app plausibly needs, and it does not ask for unrelated access at launch.

Path 4: Recovery software, only for removable media

Software-based undelete only makes sense for .apk files on an SD card, USB stick, or computer disk. The rule is stop writing to the volume immediately, then image it before scanning:

# macOS: create an image first, scan the image, keep the original untouched
sudo dd if=/dev/disk4 of=./sdcard.img bs=4m

Scanning an image rather than the live volume preserves the original for a second attempt. On a volume that is still receiving writes, success rates fall off quickly.

Prevent the next incident

Recovering is always the expensive path. Cheaper: keep a searchable backup directory.

mkdir -p ~/apk-backup
echo "$(date +%F) com.example.app 1.2.3 gptoapk" >> ~/apk-backup/index.txt

Batch-extract every sideloaded app in one loop and you will never care what the cleaner app deleted:

for p in $(adb shell pm list packages -3 | sed 's/package://'); do
  adb shell pm path "$p" | sed 's/package://' | while read -r f; do
    adb pull "$f" ~/apk-backup/ 2>/dev/null
  done
done

The -3 flag lists third-party packages only, which keeps the run fast and skips hundreds of system APKs.

One-line summary

Recovery priority for a deleted APK: pull it from the device if the app is installed, otherwise re-download from a trustworthy source and verify the certificate, and only then consider version archives or undelete tools. Scanning phone internal storage for deleted APKs is a dead end — do not spend your first hour there.