If you’re a developer and own several Android devices changes are you’ve wanted to install additional apps that aren’t included in the base install of the OS and aren’t in the Play Store.
While there are many ways to sideload apps the best way is to extract an APK from one device and install it on another.
Instead of installing third party apps that do this we are going to use Android’s developer tools to do this.
While third party apps are nice they sometimes can’t be installed so using developer tools might not only be the better way but might be the only way.
Becoming a Developer
Before we extract APKs using the Android developer tools we have to activate developer mode on your source Android device. Some devices won’t have this but all devices I’ve used do.
To do this you can read my article about the process, but the process is pretty simple.
- Go into your settings app then scroll to “About phone”.
- On devices above Android 8.0 click “System”.
- Click “About phone” and scroll until you see “Build number”.
- Click “Build number” 7 times or until a popup appears saying “You are now a developer”.
You now have the developer mode enabled and can control your device via USB.
Installing and Using ADB
Now that we have access to the phone’s developer menu we can start issuing command using
adb, the Android command line tools.
On another computer, preferable a Linux machine, install Android
If you’re on Linux (Debain/Ubuntu) the command is easy. If you’re on Windows or OS X refer to the Android website to get this installed.
sudo apt-get install android-tools-adb
adb is installed connect your phone to your computer via USB. A window will appear on your Android device asking if you want to trust the desktop / laptop as a development machine. Click that you trust it and you can start issuing commands.
Pulling the APK
To get the specific APK you want we need to get a list of all the APKs on the system.
adb shell pm list packages
Look through the list of packages and try to find the one you want.
Once you find it you need to determine where the APK is located on the system. Use the following command, replacing
com.somecompany.someapp with your package name.
adb shell pm path com.somecompany.someapp
The output will look similar to the following.
Now you can pull the APK to your local machine by issuing the following command.
adb pull /data/app/com.somecompany.someapp-2.apk
You now have a file called
com.somecompany.someapp-2.apk located on your machine that you can share or install on other devices.