Tuesday, May 6, 2025

How to install an old apk file to a new phone

The problem: An app that was installed on my old phone isn't installed on my new phone. The app is no longer available on the Play store. Fortunately, the app is still installed on my tablet.

The solution: Copy the apk file from the tablet to the phone and install.

Prerequisites: A device with the app apk (in my case, a tablet), a computer with adb installed, the new phone. Developer options need to be enabled on both the tablet and the new phone.

Steps:

  1. Connect the tablet to a computer via usb.
  2. Use adb to locate the apk. You may need to turn on developer options and turn on usb debugging for adb to locate the tablet.
  3. Open a terminal, enter
    adb devices
    to list the the connected device. If no device is listed, see step 2.
  4. enter
    adb shell pm list packages | sort
    Locate the package in the list.
  5. enter
    adb shell pm path com.package.name
    using the package name as shown in the list, this will show the full path of the apk file.
  6. enter
    adb pull data/app/com.package.name.apk
    Use the path as shown in step 5. This will copy the apk file to the computer.
  7. Disconnect the tablet from the usb and connect the phone, and as in step 2, turn on developer options and turn on usb debugging.
  8. Repeat step 3 to ensure you are properly connected.
  9. If you're lucky, you can enter
    adb install com.your.package.name.apk
    If it won't install due to the package being too old for your version of android,
    enter
    adb install --bypass-low-target-sdk-block com.package.name.apk

No comments: