Copy apk from android

Copy apk from android

Android offers multiple ways to transfer apps and data between phones. The usual way of transferring apps from your old device to a new one is by using the Tap & Go feature.

In addition to Tap & Go, Android also allows you to copy apps and data using ADB. If you just want to copy one specific APK, ADB can be used to grab a copy of APK or create a backup file with the APK and related data.

If you want to bring your Android skills to the next level, I highly recommend checking out some of the Udemy courses. Disclaimer: I’m participating in the Udemy Affiliate Program and I might get a small commission if you purchase something via the provided link. However, your price won’t be affected and I do believe the courses can help your career/business.

There are 2 methods that I want to show in this post. Using the first method you only copy the APK file, but this method should work most of the time.
The second method allows to copy also app data, but the particular app has to support this.

Disclaimer: I don’t support copying of paid apps or violating app licenses! Always check the license and conditions of the APK you’re trying to copy to make sure you comply.

Grab APK and Install It to Another Device

This method allows you to install one specific APK file that you’ve grabbed from another phone. To copy the APK file do the following:

    Get APK file path from package name

The pm command executed above should print something like this

You should substitute your package name in the previous command. I used the package name from my example app from the post about device owner — eu.sisik.devowner .

If you’re not sure how to get the package name of the app you want to copy, you can use my Power APK app for this. The main screen will display a list of installed apps and package names. You can search the app on the list by its name. Alternatively, you can start the app you want to copy. Once it’s foreground, you can get the package name with adb shell dumpsys window windows | grep «mCurrentFocus» . I described this method in one of my posts.

Note: Sometimes the app is split into multiple APK files. This usually happens when using the Instant Run feature of Android Studio. These files are usually highly customized for the device they were deployed to and are additionally running a bit differently than apps installed from regular APKs, so the method I’m describing here won’t work for this kind of APK files.

Pull the APK file from Android device to your PC

This will pull the APK file to current directory. You should use the path to APK obtained in the previous step

Install APK to target Android device

This will push the APK to the target device and execute the pm install -r command on the device. The -r option means that the app should be reinstalled in case it already exists on the target device. However, app’s data won’t get erased with this option.

Читайте также:  Как стереть гугл аккаунт с андроида самсунг

Use ADB Backup to Copy APK

This method has the advantage that you can also copy app’s data together with the APK. The disadvantage is that not all apps can be copied this way. Only apps that set the allowBackup flag to true in their AndroidManifest.xml can be copied. Luckily, the apps that target Android 6 and higher have this value set to true by default, so even if the developer did not set this flag explicitly to true, it should still be possible to perform a backup.

To check if a particular app supports backup do the following

This gave me the following output for my DevOwner app

The flags show that it should be possible to perform a backup for this specific app.

You should execute the following command to create a backup

A dialog box asking for password and confirmation should appear on your Android device. Type in your password and tap on «BACK UP MY DATA». This will backup the APK file and app data for your specified package into app.backup file. In some cases this might not work reliably. Therefore you might need to add quotes to arguments or experiment with different ADB versions.

To copy the APK and data from the generated backup file to your target Android device, use the restore command

Copy APK with Bugjaeger

If you don’t want to install ADB on your PC, you can do the same stuff as described before using the Bugjaeger app. The device that contains the original APK file should have Bugjaeger installed. To copy the app do the following

  1. Connect the devices with USB OTG cable and confirm the authorization dialogs (similar to what you do when you’re using regular ADB)
  2. Switch to the Packages tab
  3. Tap on the add button
  4. Pick «Select from installed Apps» option and tap on OK
  5. Select the apps that you want to copy from the list and tap on INSTALL

Pulling APK Files From Android Device With Bugjaeger

In case you are only interested in getting the actual APK files from the device, you can do this simply with the Bugjaeger app.

  1. Switch to the Packages section
  2. Find the package you’re interested in and click on the download icon

If you’re not sure how to get the package name of the app you’re interested in, check out my Power Apk which can extract various information from installed APK files. Power Apk is also able to pull the APK file from the device.

Use Backup & Restore with Bugjaeger

You can also perform ADB backup and restore with the Bugjaeger app.

To create a backup with Bugjaeger do the following

  1. Connect the devices with USB OTG cable and confirm the authorization dialogs (similar to what you do when you’re using regular ADB)
  2. Switch to the Backup tab
  3. Tap on the backup button at the bottom right of the screen
  4. Type a name for your backup
  5. Tick the checkbox next to Include .apk files
  6. Select the app package from the list and tab on BACKUP

Once you’ve provided a password and confirmed, there should be a new entry in the Backup section of Bugjaeger. You can now restore the backup by tapping on the restore button

Note: Not all apps will allow you to create a backup. This is influenced by the allowBackup flag defined in AndroidManifest.xml .

Examining Android Backup Files and Extracting Their Content

Bugjaeger app allows you to examine the content of ADB backup files. Once you’ve successfully created a backup as described in previous section, you can tap on the created backup item in Backup section, and the app will show you the content of the backup file. You can also import ADB backups made before with ADB by tapping on the Import button

Источник

AnatomicJC / android-backup-apk-and-datas.md

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Читайте также:  Как обновить андроид 9500

Fetch application APK

To get the list of your installed applications:

If you want to fetch all apk of your installed apps:

To fetch only one application, based of listed packages results:

Backup applications datas

To backup one application, with its apk:

To backup all datas at once:

To backup all datas in separated files:

First, you have to install the saved apk with adb:

Then restore the datas:

Extract content of adb backup file

You will need the zlib-flate binary. You will able to use it by installing the qpdf package.

Then, to extract your application backup:

Miscellaneous: remove non-wanted applications

Sometimes, you have already installed (but non wanted) apps when you buy an Android Smartphone. And you can’t uninstall these apps. So Bad. And some pre-installed app are not present on PlayStore. WTF.

You can remove them with this command, and root is not needed:

You can first disable them, then when you are sure, you can remove them.

To list disabled apps:

This comment has been minimized.

Copy link Quote reply

natevw commented Mar 13, 2021

For other platforms there’s some zlib alternatives in the thread here. E.g.:

This comment has been minimized.

Copy link Quote reply

davtur19 commented May 17, 2021

For those using adb on Windows with bash

This comment has been minimized.

Copy link Quote reply

jrd commented Jun 22, 2021

pm list packages could be replaced by cmd package list packages as the pm list is a deprecated alias and can go away at any version.

This comment has been minimized.

Copy link Quote reply

thebigsmileXD commented Aug 14, 2021

To back up your SD card or any other folder to a tar file, you can do
adb exec-out «cd /storage/sdcard0 && tar c * -» > sdcard.tar
where adb pull might fail due to the target file system not supporting case-sensitive file names etc.

This comment has been minimized.

Copy link Quote reply

ToniCipriani commented Sep 21, 2021

Powershell for individual package backup:

Mind you for encrypted devices (which is almost every one out there these days) you will be prompted for a password ever single time.

This comment has been minimized.

Copy link Quote reply

GuruGoat commented Sep 25, 2021

Powershell to get all .apk.
Inspired by @ToniCipriani’s script above!

This comment has been minimized.

Copy link Quote reply

berkes commented Nov 10, 2021

If the backup file is empty, and/or the backup command exits immediately, that may be caused by running this as non-root.

First, enable «root access» for «ADB» on your devise at Settings -> System -> Developer options.

Then restart the server as root: adb root . Now the backup commands can access the data and can actually back them up.

This comment has been minimized.

Copy link Quote reply

osamh757955 commented Nov 12, 2021

Can I transfer WhatsApp Business through adb without root
Unfortunately, I haven’t been able to do it yet

This comment has been minimized.

Copy link Quote reply

forianzsiga commented Nov 15, 2021 •

actually, for newer devices (for me Android 12, unencrypted device, and without enabling password for the backup) the backup creation give me an empty file. When I changed the extension from .adb to .ab, the backup went seamlessly. It might be something version dependent, but it may be just a typo by the publisher.

This comment has been minimized.

Copy link Quote reply

osamh757955 commented Nov 15, 2021

actually, for newer devices (for me Android 12, unencrypted device, and without enabling password for the backup) the backup creation give me an empty file. When I changed the extension from .adb to .ab, the backup went seamlessly. It might be something version dependent, but it may be just a typo by the publisher.

There are no spelling errors in the text because I can transfer the official WhatsApp by adb, but I need to download the version to an old version, but WhatsApp Business cannot make a backup Is there a version of WhatsApp Business that allows me to backup

Читайте также:  Асус лаунчер для андроид что это

This comment has been minimized.

Copy link Quote reply

thebigsmileXD commented Nov 15, 2021

I’d prefer if this gist would stay a collection of helpful commands, and not a support forum, kthxbai

This comment has been minimized.

Copy link Quote reply

osamh757955 commented Nov 15, 2021

I’d prefer if this gist would stay a collection of helpful commands, and not a support forum, kthxbai

I want to ask more

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Как скачать (скопировать) установочный apk файл с Android устройства (планшета, телефона, читалки)

Например, прекрасное приложение для чтения RSS лент новостей gReader было удалено из Google Play. Его конечно можно скачать из непроверенных источников, в том числе с форума 4pda. Но, к сожалению, разработчики большинства приложений и магазин приложений Гугл Плей не предоставляют проверочные хэш суммы (md5, sha1, sha256), поэтому нет никакой гарантии того, что в установочный файл не было внедрено зловредное программное обеспечение.

Но поскольку установочный .apk файлы сохраняются на Android устройстве после установки, то можно скачать (скопировать) их с Андроид устройства и установить уже без магазина приложений. При этом на Android планшете/телефоне/читалке/приставке может понадобиться включить разрешение на установку приложений из недостоверных источников.

Как скачать (скопировать) установочный apk файл с Android устройства при помощи ADB

  1. В Windows может понадобиться установка USB драйвера для вашего Андроид устройства. В Linux этого не требуется в 99% случаев.
  2. Установите Android Device Bridge (ADB). Для этого нужно скачать бинарные файлы ADB для вашей платформы (Windows, Mac, Linux). Для работы с ADB, достаточно скачать Android SDK Platform-Tools.

В Ubuntu установить ADB проще простого, достаточно выполнить следующую команду в терминале:

sudo apt install android-tools-adb

  • Подключите Android устройство к компьютеру по USB кабелю (ADB можно пользоваться и по Wi-Fi, но для простоты опустим этот случай).
  • Для вывода всех установленных на Андроид устройстве APK пакетов наберите в терминале (командой строке)

    adb shell pm list packages

    Если мы знаем часть названия APK пакета, то можем вместо вывода всех приложений сразу вывести только те, в которых встречается эта часть названия. Например, для поиска gReader достаточно ввести в наберите в терминале (командой строке)

    adb shell pm list packages -f | grep название_пакета

    В ответ должны получить полное название пакета. В случае с gReader это будет

    adb shell pm list packages -f | grep greader
    package:com.noinnion.android.greader.rea der

    Далее нужно найти расположение пакета при помощи команды pm path название_пакета (без приставки «package:» из команды pm list packages)

    adb shell pm path com.noinnion.android.greader.reader
    package:/data/app/com.noinnion.android.g reader.reader-1/base.apk

    Остаётся только скачать (скопировать) APK файл с Android устройства на компьютер при помощи команды adb pull путь_к_пакету имя_пакета.apk. При этом можно опустить имя_пакета.apk, тогда пакет сохранится с тем же самым именем, под которым хранится на устройстве (для greader и многих других приложений это будет base.apk)

    adb pull /data/app/com.noinnion.android.greader.r eader-1/base.apk=com.noinnion.android.gr eader.reader greader.apk

    Если этот способ кажется слишком сложным, то смотрите дальше.

    Бесплатное Андроид приложение AirDroid позволяет получить доступ к Android устройству с компьютера по Wi-Fi. При этом мы сможем видеть на экране компьютера экран смартфона, но в данном случае нам понадобится другая полезная фишка приложения — способность передавать файлы с Android устройства на компьютер (скинуть файлы с компьютера на Android смартфон, планшет, читалку, ТВ приставку тоже можно). При этом AirDroid удобно показывает список Андроид приложений установленных на устройстве, так что искать их расположение не придётся.

    Как скачать (скопировать) установочный apk файл с Android устройства при помощи Андроид приложения AirDroid

    1. Установите приложение AirDroid на Android устройство.
    2. Подключите устройство по Wi-Fi
    3. Запустите AirDroid
    4. Регистироваться нам вовсе не понадобится. поэтому пропускаем этот шаг (нажав на кнопку «Пропустить»).
    5. Нажмите «AirDroid Web»
    6. Введите на компьютере в интернет-обозревателе (браузере) адрес, указанный в AirDroid Web, например: http://192.168.1.177:8888
    7. На Android устройстве согласитесь на подключения компьютера к телефону, нажав на кнопку «Принять»
    8. В браузере на компьютере должны появится «рабочий стол» с иконками. Нажмите на Apps
    9. Если навести мышкой на нужное приложение, то напротив этого приложения появляется иконка Download, позволяющая скачать данное приложение на компьютер. Также можно поставить галочки напротив всех приложений, которые хотите скопировать с устройства на компьютер, после чего нажать кнопку Download правом верхнем углу окна «Apps»

    Источник

  • Оцените статью