Several years ago I was doing some Android development. One of the things I appreciated the most about Android was the relative simplicity of being able to install apps to a device, unlike iOS which requires jumping through numerous hoops (although it is getting better with Xcode 9).
As a refresher for myself (and good documentation in the case I need to repeat these steps sometime in the future), here are the steps to take to install an APK app bundle onto an Android device.
- Install the platform tools (such as
adb). Download the platform tools from Google's website.
- Unzip the downloaded file.
- On the Mac, copy any wanted utilities to the
/usr/local/binfolder (create the folder if necessary). For this purpose,
adbneeds to be copied over.
- On an Android device, make sure the Developer mode is enabled. If not, go to Settings > About Phone/Tablet, then tap on the Build Number seven times to enable the Developer mode (otherwise,
adbwon't be able to see the device).
- Ensure that USB Debugging is also enabled in the Developer Options
- Verify that the device is visible with the command:
- To install the apk file onto the device:
adb install -r path/to/apk_file
- If there are multiple devices or emulators connected, the APK can be installed to a specific device:
adb -s FA3C3S903152 install -r path/to/apk_file
- If needed, uninstall the app with the command:
adb uninstall com.example.appname
Note: If the app you try and load an app which requires a higher API version than what is on the phone, you'll see an error like the following:
$ adb install -r example.apk example.apk: 1 file pushed. 3.1 MB/s (8255173 bytes in 2.560s) pkg: /data/local/tmp/example.apk Failure [INSTALL_FAILED_OLDER_SDK]