Tutorials

How to Extract an APK from an Installed Android App with ADB (Including Split APKs)

Springmusk Springmusk 10 min read 0 comments

TL;DR: Connect the phone over ADB, find the app with pm list packages, get its on-device paths with pm path, and copy each file with adb pull. Most modern apps are split APKs, so pulling only base.apk is not enough: pull every split and reinstall them together with adb install-multiple.

There are good reasons to pull an APK off a phone you own: backing up an app before a reset, moving your own build to another device for testing, or getting a copy to study with a decompiler. Android does not offer a built-in “export APK” button, but the Android Debug Bridge (ADB) can do it in three commands, with no root and no third-party app. The catch is that most guides stop at the first file and miss the rest of the app.

Since August 2021, new apps on Google Play have had to use the Android App Bundle format, which means Play delivers an app as a set of split APKs matched to the device instead of one universal file. Google has put the typical download saving from that approach at about 15 percent. So the app on your phone is often not one APK at all. It is a base APK plus configuration splits for its CPU architecture, screen density, and language. Pull only the base file and the copy may install but crash, lose its native libraries, or show the wrong language resources.

This guide covers the full process: finding the package, pulling a single APK, pulling every split, reinstalling the set, and fixing the common failures. It assumes you have ADB installed and USB debugging enabled. If you have not set ADB up yet, start with the site’s install guide and come back here.

First, the ground rules

Extract only apps you have a right to copy: your own apps, open-source apps, or apps whose licence allows it. Do not redistribute paid or proprietary apps you pulled from your phone. An extracted APK also contains only the app itself, not its private data. Account logins, databases, and files under /data/data/ stay on the device and are not reachable without root, which is a separate limitation and a good thing for other people’s data.

One more expectation to set: the pulled APK keeps the developer’s original signature. That means you can reinstall it over the same app without a signature conflict, but you cannot modify it and reinstall it under the same signature. Modifying an APK means re-signing it, which is a different process covered in the site’s guide to APK signature schemes.

Step 1: Connect and confirm the device

Plug the phone in over USB, accept the debugging prompt on the phone, then check that ADB sees it:

adb devices

You want a line ending in device, not unauthorized or offline. If the phone shows as unauthorized, revoke the debugging authorisations on the phone under Developer options, reconnect, and accept the prompt again. ADB itself is a client-server tool: a client on your computer talks to a server on your computer, which talks to a daemon on the device. When a command hangs or a device vanishes, restarting that server with adb kill-server followed by adb devices fixes more problems than reinstalling anything.

Step 2: Find the package name

Android identifies apps by package name, such as com.example.app, not by the name shown on the home screen. List third-party apps with:

adb shell pm list packages -3

The -3 flag limits the list to third-party apps and cuts out most system packages. Narrow it further by piping through a search tool: grep on macOS and Linux, findstr on Windows:

adb shell pm list packages -3 | grep -i maps
adb shell pm list packages -3 | findstr /i maps

If you already know roughly what you are looking for, that filter is usually enough. Two other flags are worth knowing. adb shell pm list packages -s lists system apps only, and adb shell pm list packages -f lists each package with the path to its APK in the same output, which is a shortcut to the next step.

Step 3: Get the APK path on the device

With the package name in hand, ask the package manager where the files live:

adb shell pm path com.example.app

For a single-APK app the output is one line:

package:/data/app/com.example.app-1/base.apk

For a split app it is several lines, one per file:

package:/data/app/com.example.app-1/base.apk
package:/data/app/com.example.app-1/split_config.arm64_v8a.apk
package:/data/app/com.example.app-1/split_config.xxhdpi.apk
package:/data/app/com.example.app-1/split_config.en.apk

That list is the whole job. Every line after package: is a file you need. The random-looking suffix after the package name (the -1 above) varies per install, so always copy the path from the command output rather than guessing it. If pm path returns nothing, the package name is wrong, the app is installed for a different user profile, or the app is not installed at all. Re-run the list command and check the spelling character by character.

Step 4: Pull a single APK

adb pull copies a file from the device to your computer. Pass the device path from the previous step, then a local destination:

adb pull /data/app/com.example.app-1/base.apk ./example.apk

Give the local file a recognisable name. If you pull several apps into one folder, the default base.apk name will overwrite itself, which is an easy mistake when you are in a hurry. Check the result: the file should exist locally, its size should be more than a few kilobytes, and it should open as a ZIP archive, since an APK is a ZIP file. A zero-byte file means the pull failed partway through, not that the app is empty.

Step 5: Pull every split APK

This is the step most guides skip, and it is the one that decides whether the extracted copy actually works. A split APK set has three dimensions, and each one serves a different device configuration:

Split type Example file name What it contains What breaks if you skip it
Base base.apk Code, manifest, and shared resources Nothing installs at all
ABI (CPU architecture) split_config.arm64_v8a.apk Native libraries for one CPU type Crashes in native code, or features that depend on it
Screen density split_config.xxhdpi.apk Images sized for one screen density Blurry or missing graphics
Language split_config.en.apk Strings for one locale Missing or fallback text

Pulling splits one by one is fine for a small app, but a script is less error-prone. On macOS and Linux, this loop pulls every path pm path reports into a folder named after the package:

mkdir -p extracted/com.example.app
adb shell pm path com.example.app | tr -d '\r' | sed 's/package://' | while read apk; do
  adb pull "$apk" extracted/com.example.app/
done

On PowerShell, the equivalent is:

New-Item -ItemType Directory -Force extracted\com.example.app
adb shell pm path com.example.app | ForEach-Object {
  $path = $_.Replace('package:', '').Trim()
  adb pull $path extracted\com.example.app\
}

After the loop, count the files in the folder and compare with the number of lines pm path printed. If the counts differ, one pull failed and you should re-run it before going further. A folder with only base.apk in it is the classic incomplete extraction.

Step 6: Reinstall the extracted set

A single APK installs with the ordinary command:

adb install ./example.apk

A split set must go in as one install session, with the base APK first:

adb install-multiple base.apk split_config.arm64_v8a.apk split_config.xxhdpi.apk split_config.en.apk

Use the actual file names in your folder, not the examples above. adb install-multiple pushes every part and installs them together; if one part fails, the whole install is abandoned rather than leaving a half-installed app behind. Adding -r reinstalls over an existing copy while keeping its data, which is useful when you are restoring a backup onto a phone that already has the app.

Do not try to install a split set by tapping base.apk on the phone. The system installer handles one file at a time, so the splits never join the install, and the app will be incomplete even though the install reports success.

What the extracted APK is good for next

Once you have a complete set, the usual next steps all build on it. Decompiling the base APK with JADX gives you readable Java source for study, which the site covers in its JADX guide. Checking the manifest and permissions before installing an unfamiliar APK is covered in the manifest guide. And if you go on to modify and rebuild an APK, the signature-scheme guide explains why the rebuilt file needs a new signature and which scheme to use. Extraction is the unglamorous first step that makes all of those possible, and it is worth doing completely rather than quickly.

Troubleshooting

Symptom Likely cause Fix
unauthorized in adb devices The phone has not accepted this computer Revoke USB debugging authorisations, reconnect, accept the prompt
no devices/emulators found Bad cable, driver, or USB debugging off Use a data cable, check Developer options, restart the ADB server
pm path prints nothing Wrong package name or wrong user profile Re-list packages, check spelling, try --user for a work profile
Install succeeds but the app crashes A split APK is missing Re-pull every path from pm path and use install-multiple
INSTALL_FAILED_UPDATE_INCOMPATIBLE Signature mismatch with the installed copy Uninstall the installed copy first, then install the extracted set
Pulled file is 0 bytes Interrupted transfer Delete it and re-run adb pull for that path

One failure deserves a special note. INSTALL_FAILED_UPDATE_INCOMPATIBLE usually means the copy already on the phone was signed differently from the one you are installing, for example a Play Store build versus a developer build with the same package name. Android refuses to mix signatures for the same package, and no flag overrides that. Uninstalling first is the fix, at the cost of the app’s data, so back that data up separately if it matters.

Key takeaways

  • Find the package with pm list packages -3, get its paths with pm path, and copy each file with adb pull. No root is needed for the APK files themselves.
  • Always pull every line pm path prints. Modern Play apps are split across base, ABI, density, and language files.
  • Reinstall split sets with adb install-multiple, base APK first, in a single command. Tapping base.apk alone leaves the app incomplete.
  • Name pulled files clearly and verify the file count matches pm path before you trust the backup.
  • Extract only apps you have a right to copy, and do not redistribute paid or proprietary APKs.

References

Join the discussion

Your email address will not be published. Required fields are marked *