By Finder

2010-10-27 12:06:20 8 Comments

How do I get the apk file from an android device? Or how do I transfer the apk file from device to system?


@Farid Haq 2019-01-28 03:42:32

Steps to Download APK from Device to Desktop

A) Make sure that your running (emulator/real Device). To check use this command

adb devices

B) Select all the available package list installed in your device. You can use grep command to select the specific package you intend to download.

adb shell pm list packages
adb shell pm list packages -f -3

Output (List of available packages )


C) Copy the package (which you like to download) from the above link. Form our case I choose this (com.example.myapplication) package

Syntax : adb shell pm path [your_package_name]
Command: adb shell pm path com.example.myapplication



D) Finally, To download APK from your (emulator/real device)

Syntax : adb pull /data/app/[your_package_name]-1/base.apk  [your_destination_path]
Command: adb pull /data/app/com.example.myapplication-3j4CVk0Tb2gysElgjz5O6A==/base.apk /Users/$(whoami)/Documents/your_apk.apk

Example: Trying to pull this CertInstaller.apk file in your local machine ( Mac )

adb pull /system/app/CertInstaller/CertInstaller.apk /Users/$(whoami)/Documents/APK/download_apk/

E) Confirm in your local directory

ls -la /Users/$(whoami)/Documents/

@Carles Alcolea 2019-02-25 14:05:01

The objective is to extract a single apk, yet in step 4 you pull two additional files without explanation or previous reference.

@Farid Haq 2019-02-26 00:35:41

I modified this post by clarifying every step.hope this modification will be helpful and easy to understand.

@Oush 2018-12-10 12:30:32

  1. Open the app you wish to extract the apk from on your phone.
  2. Get the currently opened app with:

    adb shell dumpsys activity activities | grep mFocusedActivity
  3. Get the path to the package name

    adb shell pm path <packagename.apk>

4.Copy the path you got to the sdcard directory

    adb shell cp /data/app/<packagename.apk> /sdcard

5.Pull the apk

    adb pull /sdcard/base.apk


If step no 2 doesn't work use this:

adb shell dumpsys window windows | grep mCurrentFocus

@Gerben Versluis 2019-01-22 15:48:07

I really liked all these answers. Most scripts to export and rename all of them were written in Bash. I made a small Perl script which does the same (which should work both in Perl for windows and linux, only tested on Ubuntu).

#!/usr/bin/perl -w
# Automatically export all available installed APK's using adb
use strict;
print "Connect your device...\n";
system("adb", "wait-for-device");
open(my $OUT, '-|', 'adb', 'shell', 'pm', 'list', 'package', '-f');
my @list = split(/\s*/, `adb shell pm list packages -f`);
my $count = 0;
while(my $line = <$OUT>) {
        $line =~ s/^\s*|\s*$//g;
        my ($type, $path, $package) = $line =~ /^(.*?):(.*)=(.*)$/ ? ($1,$2,$3) : die('invalid line: '.$line);
        my $category = $path =~ /^\/(.*?)\// ? $1 : 'unknown';
        my $baseFile = $path =~ /\/([^\/]*)$/ ? $1 : die('Unknown basefile in path: '.$path);
        my $targetFile = "$category-$package.apk";
        print "$type $category $path $package $baseFile >> $targetFile\n";
        system("adb", "pull", $path);
        rename $baseFile, $targetFile;
  1. Make sure adb(.exe) is in your path or same directory
  2. Connect your phone
  3. Run

The output is something similar to:

# ./
Connect your device...
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
package system /system/app/YouTube/YouTube.apk YouTube.apk >>
5054 KB/s (11149871 bytes in 2.154s)
package data /data/app/com.ghostsq.commander-1/base.apk com.ghostsq.commander base.apk >> data-com.ghostsq.commander.apk
3834 KB/s (1091570 bytes in 0.278s)
package data /data/app/de.blinkt.openvpn-2/base.apk de.blinkt.openvpn base.apk >> data-de.blinkt.openvpn.apk
5608 KB/s (16739178 bytes in 2.914s)

@vanduc1102 2019-01-08 16:51:51

I got a does not exist error

Here is how I make it works

adb shell pm list packages -f | findstr zalo

adb shell
mido:/ $ cp /data/app/com.zing.zalo-1/base.apk /sdcard/zalo.apk
mido:/ $ exit

adb pull /sdcard/zalo.apk Desktop

/sdcard/zalo.apk: 1 file pulled. 7.7 MB/s (41895394 bytes in 5.200s)

@moberme 2018-12-21 17:48:01

No Root and no ADB tools required method. Install MyAppSharer app from the play store.

@Yojimbo 2013-08-01 20:01:40

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name. On more recent versions of Android (Oreo and Pie), an unpredictable random string is appended. The following sequence of commands is what worked for me on a non-rooted device:

1) Determine the package name of the app, e.g. "com.example.someapp". Skip this step if you already know the package name.

adb shell pm list packages

Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

2) Get the full path name of the APK file for the desired package.

adb shell pm path com.example.someapp

The output will look something like

3) Using the full path name from Step 2, pull the APK file from the Android device to the development box.

adb pull /data/app/com.example.someapp-2.apk path/to/desired/destination

@Muhannad A.Alhariri 2013-10-03 07:08:02

This is the best answer , no need to rrot the device !! thanks a lot

@b.mcewan 2013-10-03 14:59:20

This worked on all of my Android devices, and should be the accepted answer.

@Christian Melchior 2014-02-20 09:32:16

I used the above to create a bash script that makes it a one-liner:

@sschuberth 2014-11-24 15:14:56

In Android 5.0, the path to the installed APK as changed to /data/app/<package>-1/base.apk. I've updated my script accordingly.

@gatzkerob 2014-12-21 16:42:09

In order for this to work, first I had to move the app from SD storage to phone storage. The app should be listed under "/data/app/".

@Wilf 2015-01-03 09:32:47

I was able use the terminal emulator app and fx file manager and this worked :) I was also able to use grep to search the list of packages: pm list packages | grep NAME

@Delcasda 2015-03-16 15:57:47

this does not work if the file is under /mnt/asec folder but it does if the file is on /data/app. Tested on a non rooted Galaxy Note 4

@aresz 2015-10-23 18:07:15

beginner question, once you pull it from the device, where is it saved to?

@manfcas 2015-11-03 22:33:50

If the app is published on the Play Store, you can get the package name from the app page on the Play Store.

@Polar Bear 2016-01-21 22:15:34

Thanks, this was the perfect answer, it should be the accepted answer.

@Hitechcomputergeek 2017-01-03 14:57:12

pm list packages supports the -f flag, which lists the location of the .apk for you, like package:/data/app/‌​‌​s. The built-in pm help is useless, but pm can also filter types of packages too, see for more info. EDIT: just noticed that the answer below says this, but that answer isn't nearly as upvoted as this one.

@VasiliNovikov 2017-04-23 12:04:48

Does this allow extracting the apk from a paid or "limited access" applications? I have no intentions to, just curious.

@vikramvi 2017-09-15 16:34:42

also beaware that package may NOT be same as actual app name, which is quite confusing why developers do like that.

@Bevor 2018-02-09 13:56:13

Doesn't work for me. I get the following error: adb: error: remote object '/data/app/' does not exist. If I browse these folders with a file browser, the folders are empty.

@Tschallacka 2018-05-16 20:03:26

An easier way to get the package name is by looking up the package in google play on your pc browser. the ?id=com.publisher.appname gives away the package name, saving you browsing a huge list for the correct package name

@P Moran 2018-06-12 19:34:37

I also found that you have to have permission set correctly on your destination machine. I was able to run the adb pull with no apparent issues but the file never appeared. Changing the permission to full control solved that.

@Ross Patterson 2018-07-02 23:40:27

If anyone wants a one-liner: adb pull $(adb shell pm path $(adb shell pm list packages | grep -i ${APP_NAME_SEARCH_TERM} | head -n 1 | cut -d ":" -f 2) | cut -d ":" - f 2)

@colin 2018-10-04 23:34:40

I had a similar problem as @Bevor, when pulling I got the error that the apk "does not exist". I fixed it by using adb shell and then cp PathToApk /sdcard/ and then copying from the sdcard.

@Watson 2020-03-18 10:45:23

I had a similar problem as @Bevor, this solves it by using the downloads folder as an intermediate:

@himanshuxd 2020-04-09 10:48:09

Yes this simple answer worked perfectly.

@Maurits Rijk 2010-10-27 12:12:09

Use adb. With adb pull you can copy files from your device to your system, when the device is attached with USB.

Of course you also need the right permissions to access the directory your file is in. If not, you will need to root the device first.

If you find that many of the APKs are named "base.apk" you can also use this one line command to pull all the APKs off a phone you can access while renaming any "base.apk" names to the package name. This also fixes the directory not found issue for APK paths with seemingly random characters after the name:

for i in $(adb shell pm list packages | awk -F':' '{print $2}'); do adb pull "$(adb shell pm path $i | awk -F':' '{print $2}')"; mv base.apk $i.apk 2&> /dev/null ;done

If you get "adb: error: failed to stat remote object" that indicates you don't have the needed permissions. I ran this on a NON-rooted Moto Z2 and was able to download ALL the APKs I did not uninstall (see below) except youtube.

adb shell pm uninstall --user 0   <--- kills presidential alert app!

(to view users run adb shell pm list users) This is a way to remove/uninstall (not from the phone as it comes back with factory reset) almost ANY app WITHOUT root INCLUDING system apps (hint the annoying update app that updates your phone line it or not can be found by grepping for "ccc")

@Finder 2010-10-27 13:17:42

THanks Maurits Rijk. Please assist me. I want to copy the iTwips.apk file from the device to system. I am using the following command. is it correct ? I got error "Android2.2Froyo/sdcard/iTwips.apk" does not exits... /Users/bbb/Android/android-sdk-mac_86/tools/adb pull Android2.2Froyo/sdcard/iTwips.apk /Users/bbb Thanks is advance.......

@Maurits Rijk 2010-10-27 13:56:53

On my device (Android 2.1) the command would be "adb pull /sdcard/test.jpg" to copy test.jpg from my sd card to the current dir. Please locate your iTwips.apk file first using "adb shell". This start a shell on your device and you can use the standard Unix commands like ls and cd to browse your directories.

@Finder 2010-10-27 16:15:13

Hi, Actually the iTwips.apk stored in the internal memory on the device. how can I use the shell for this one? I am using the following command adp -d <devicenumber> shell .. But it does not work.. please assist me.. THanks in advance.

@Finder 2010-10-27 16:40:36

Hi, Thank u very much. I can get the images from sdcard now. but I want to pull the apk file from device (managementApplication folder). The iTwips apk is stored on the Application folder. Please assist me.

@Maurits Rijk 2010-10-27 18:10:43

It is possible that you don't have permissions to read from that folder. In that case you will first need root access to your device. How to do this depends on the device you have. Google device type + root access and you will probably find lots of information.

@Isa A 2016-06-09 05:10:39

@Finder @Maurits Rijk Actually, you don't have to root the device just to pull the apk. As long as you know the full path of that apk. If the apk is installed, find the full path by first looking at the package name with adb shell pm list packages, and its full path adb shell pm path then from your pc, you can simply adb pull /full/path/to/your.apk

@methodsignature 2018-06-05 18:59:04

For instructions, see answer from Yojimbo.

@Izzy 2018-10-14 21:10:55

On Linux, I actually had to strip the CR first (or the first letter was eaten): path="${path//[$'\t\r\n']}" (yeah, to be on the safe side I also stripped NL and tabs along; I always use this fragment for cleanup).

@Mama Foo 2020-02-20 02:25:46

Worth noting that if some APKs have the same name, this will overwrite them, so you really need to do the commands specified by yojimbo instead.

@Zaman 2020-04-18 01:05:44

any suggest using powershell,cmd or git bcs i try but no luck :(

@Vitaly Dyatlov 2018-06-10 07:58:08

One liner which works for all Android versions:

adb shell 'cat `pm path | cut -d':' -f2`' > app.apk

@Vitaly Dyatlov 2018-06-10 15:05:43

@AlexP. what did you want to tell by the link above?

@Sirsendu 2018-06-06 12:54:40

Simplest one is: Install "ShareIt" app on phone. Now install shareIt app in PC or other phone. Now from the phone, where the app is installed, open ShareIt and send. On other phone or PC, open ShareIt and receive.

@Saahithyan Vigneswaran 2016-12-25 17:05:00

This will help for someone who is looking for a non technical answer

This is simple hack

Download the application App Share/Send Pro from google play store. Select the app you want to send and method send application.

I usually use Bluetooth to send applications to my pc or another phone.

@APEXBoi 2018-06-06 05:35:08

It's not easy to use

@user3350906 2018-02-23 10:11:33

wanna very, very comfortable 1 minute solution?

just you this app (smart file manager from google play).

tap "apps", choose one and tap "backup". it will end up on your file system in app_backup folder ;)

@RVR 2018-02-13 11:57:19

C:\Users\xyz>adb shell pm list packages -f | findstr whatsapp

C:\Users\xyz>adb pull /data/app/com.whatsapp-1/base.apk Desktop
/data/app/com.whatsapp-1/base.apk: 1 f.... 13.8 MB/s (32803925 bytes in 

@8bitcartridge 2018-02-28 18:23:37

This is the most straightforward way in my opinion. Thanks!

@Jeeva 2019-02-21 11:42:45

guys using linux or mac instead of findstr use grep

@HEXcube 2018-01-01 18:17:02

Try this one liner bash command to backup all your apps:

for package in $(adb shell pm list packages -3 | tr -d '\r' | sed 's/package://g'); do apk=$(adb shell pm path $package | tr -d '\r' | sed 's/package://g'); echo "Pulling $apk"; adb pull -p $apk "$package".apk; done

This command is derived from Firelord's script. I just renamed all apks to their package names for solving the issue with elcuco's script, i.e the same base.apk file getting overwritten on Android 6.0 "Marshmallow" and above.

Note that this command backs up only 3rd party apps, coz I don't see the point of backing up built-in apps. But if you wanna backup system apps too, just omit the -3 option.

@MarSoft 2017-10-12 14:48:49

Yet another bash script (i.e. will work for most unix-based systems). Based on the answer by Pedro Rodrigues, but is slightly easier to use.

Improvements over Pedro's version:

  1. Original approach did not work for me on Android 7: adb pull kept complaining about no such file or directory while adb shell could access the file. Hence I used different approach, with temporary file.
  2. When launched with no arguments, my script will just list all available packages. When partial package name is provided, it will try to guess the full package name. It will complain if there are several possible expansions.
  3. I don't hardcode destination path; instead APKs are saved to current working directory.

Save this to an executable file:

# Obtain APK file for given package from the device connected over ADB

if [ -z "$1" ]; then
    echo "Available packages: "
    adb shell pm list packages | sed 's/^package://'
    echo "You must pass a package to this function!"
    echo "Ex.: android_pull_apk \"\""
    exit 1

fullname=$(adb shell pm list packages | sed 's/^package://' | grep $1)
if [ -z "$fullname" ]; then
    echo "Could not find package matching $1"
    exit 1
if [ $(echo "$fullname" | wc -l) -ne 1 ]; then
    echo "Too many packages matched:"
    echo "$fullname"
    exit 1
echo "Will fetch APK for package $fullname"

apk_path="`adb shell pm path $fullname | sed -e 's/package://g' | tr '\n' ' ' | tr -d '[:space:]'`"
apk_name="`basename ${apk_path} | tr '\n' ' ' | tr -d '[:space:]'`"


tmp=$(mktemp --dry-run --tmpdir=/sdcard --suffix=.apk)
adb shell cp "${apk_path}" "$tmp"
adb pull "$tmp" "$destination"
adb shell rm "$tmp"

[ $? -eq 0 ] && echo -e "\nAPK saved in \"$destination\""

@Pedro Rodrigues 2017-04-16 21:34:14

On unix systems, you can try this function:

function android_pull_apk() {
    if [ -z "$1" ]; then
        echo "You must pass a package to this function!"
        echo "Ex.: android_pull_apk \"\""
        return 1

    if [ -z "$(adb shell pm list packages | grep $1)" ]; then
        echo "You are typed a invalid package!"
        return 1

    apk_path="`adb shell pm path $1 | sed -e 's/package://g' | tr '\n' ' ' | tr -d '[:space:]'`"
    apk_name="`adb shell basename ${apk_path} | tr '\n' ' ' | tr -d '[:space:]'`"

    mkdir -p "$destination"

    adb pull ${apk_path} ${destination}
    echo -e "\nAPK saved in \"$destination/$apk_name\""
  • Example: android_pull_apk
  • Note: To identify the package: adb shell pm list packages

@SamG 2016-12-02 13:53:30

The procedures outlined here do not work for Android 7 (Nougat) [and possibly Android 6, but I'm unable to verify]. You can't pull the .apk files directly under Nougat (unless in root mode, but that requires a rooted phone). But, you can copy the .apk to an alternate path (say /sdcard/Download) on the phone using adb shell, then you can do an adb pull from the alternate path.

@Jonathan Cottrill 2016-12-22 14:54:36

The accepted answer (including the adb shell commands from @Isa A's comment) worked fine for me on Android 7.1.1, not rooted.

@elcuco 2015-12-09 08:59:40

Completing @Yojimbo 's answer, this is what I did (Linux/Mac only, will not work out of the box on Windows... maybe in git's bash shell):

for i in $(adb shell pm list packages -f -3 | cut -d= -f 1 | cut -d ":" -f 2); do adb pull $i; done

This is ugly bash, but works :)

EDIT: It no longer works on AndroidM: all files are named "base.apk" under another dir. Should be "trivial" to fix.

@Jeff Brateman 2015-04-17 21:58:26

All these answers require multiple steps for each apk file retrieved from the device. 1. determine package name, 2. find the file, and 3. download it. I built a simple apk_grabber python script to do this for any app that matches a given regex, and then decompiles those apks into jar files.

@Pramod Mahato 2014-09-16 10:11:08

Here's how you do it:

Download and install APK Extractor in your device. It is free, and is compatible in almost all of the Android devices. Another plus point is it does not even require root or anything to work. After you have it installed, launch it. There you will see a list of apps which are in your device, which include the apps you’ve installed later, along with the system apps. Long press any app you want to extract (you can select multiple or all apps at once), and click on the extract option you see in the top. You will also have the option to share via Bluetooth or messaging. You’re done, you will see the extracted apps as AppName_AppPackage_AppVersionName_AppVersionCode.apk, which will be saved in the path /sdcard/ExtractedApks/ by default.

For detailed description for how to extract apk files in android, visit:

@m01 2014-04-25 07:57:47

If you know (or if you can "guess") the path to the .apk (it seems to be of the format /data/app/com.example.someapp-{1,2,..}.apk to , then you can just copy it from /data/app as well. This worked even on my non-rooted, stock Android phone.

Just use a Terminal Emulator app (such as this one) and run:

# step 1: confirm path
ls /data/app/com.example.someapp-1.apk
# if it doesn't show up, try -2, -3. Note that globbing (using *) doesn't work here.
# step 2: copy (make sure you adapt the path to match what you discovered above)
cp /data/app/com.example.someapp-1.apk /mnt/sdcard/

Then you can move it from the SD-card to wherever you want (or attach it to an email etc). The last bit might be technically optional, but it makes your life a lot easier when trying to do something with the .apk file.

@Paulo Miguel Almeida 2013-06-16 16:49:41

I've seen that many solutions to this problem either you have to root your phone or you have to install an app. Then after much googling I got this solution for non rooted/rooted phones.

To list which apps you got so far.

adb shell pm list packages

Then you may select an app, for instance twitter

adb backup -apk

An important thing here is to not set up a password for encrypt your backup

This is going to create a file named as backup.ap, but you still can't open it. For this you got to extract it again but using the dd command.

dd if=backup.ab bs=24 skip=1 | openssl zlib -d > backup.tar

After this all you have to do is to extract the tar content and it's done.

Hope it works for you guys

@kodi 2013-09-03 21:55:07

From…, if your openssl doesn't have zlib, this might work: dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(‌​" | tar -xvf -

@zeeshan 2014-07-15 17:53:21

This is what worked for me, not the procedure in the accepted answer. And it really helped me today when I needed APK of one of my old apps but it was not available to me other than from my phone.

@Nico Wiedemann 2017-09-26 08:41:44

Here are more information if your openssl lacks zlib support:…

@Faris Al-Abed 2013-08-30 06:45:50

No root is required:

This code will get 3rd party packages path with the name so you can easily identify your APK

adb shell pm list packages -f -3

the output will be


now pull that package using below code:

adb pull /data/app/XX.XX.XX.apk

if you executed above cmd in C:>\ , then you will find that package there.

@Drag0 2015-10-19 19:55:29

This is awesome answer! Thank you very much :)

@IgorGanapolsky 2016-04-25 16:36:01

For some reason I cannot find APKs in my /data/app/ directory. There is always a subdirectory there.

@palindrom 2017-04-02 09:53:31

for system apps use -f -s instead of -f -3

@surhidamatya 2013-08-14 11:39:09

I haven't used code to pull .apk file from mobile but i have been using software to extract .apk file from mobile and software i have used are below with google play link:

  1. ES File Explorer File Manager
  2. ASTRO Cloud & File Manager 3.Software Data Cable

Hope it helps You.

@schultzter 2014-05-23 21:10:05

I used ES File Explorer. I'm not rooted. I just went to Tools -> App Manager and long-pressed the app I wanted the APK for. This selected the app (and allowed me to select others). I think pressed the Share button and was able to send the APK to myself (using Push Bullet, but what ever works for you).

@surhidamatya 2014-05-27 06:36:26

If you are not rotted then you can try App backup and restore‌​p

@aditya.gupta 2012-05-30 11:39:27

As said above, you can get the apk by using the pull command in adb.

Since, you are talking about your installed applications, go ahead and look in the /data/app directory of your Android filesystem. You will find the APK's there.

Then use the adb command - adb pull /data/data/appname.apk

Related Questions

Sponsored Content

24 Answered Questions

[SOLVED] Is there a way to get the source code from an APK file?

50 Answered Questions

[SOLVED] Is there a unique Android device ID?

34 Answered Questions

[SOLVED] How to avoid reverse engineering of an APK file?

39 Answered Questions

[SOLVED] How to get screen dimensions as pixels in Android

52 Answered Questions

32 Answered Questions

[SOLVED] How to save an activity state using save instance state?

8 Answered Questions

[SOLVED] Android error: Failed to install *.apk on device *: timeout

11 Answered Questions

[SOLVED] Proper use cases for Android UserManager.isUserAGoat()?

33 Answered Questions

[SOLVED] How do you install an APK file in the Android emulator?

Sponsored Content