I built my project using the new Android App Bundle format. With APK files, I can download the APK to my device, open it, and immediately install the app. I downloaded my app as a bundle (.aab format) and my Nexus 5X running Android 8.1 can't open the file. Is there any way to install AABs on devices in the same convenient manner as APKs?
This question is related to
android
android-app-bundle
Installing the aab directly from the device, I couldn't find a way for that.
But there is a way to install it through your command line using the following documentation You can install apk to a device through BundleTool
According to "@Albert Vila Calvo" comment he noted that to install bundletools using HomeBrew use brew install bundletool
You can now install extract apks from aab file and install it to a device
Extracting apk files from through the next command
java -jar bundletool-all-0.3.3.jar build-apks --bundle=bundle.aab --output=app.apks --ks=my-release-key.keystore --ks-key-alias=alias --ks-pass=pass:password
Arguments:
Then you will have a file with extension .apks So now you need to install it to a device
java -jar bundletool-all-0.6.0.jar install-apks --adb=/android-sdk/platform-tools/adb --apks=app.apks
Arguments:
For MAC:
brew install bundletool
bundletool build-apks --bundle=./app.aab --output=./app.apks
bundletool install-apks --apks=app.apks
Use (on Linux): cd android ./gradlew assemblyRelease|assemblyDebug
An unsigned APK is generated for each case (for debug or testing)
NOTE: On Windows, replace gradle executable for gradlew.bat
You cannot install app bundle [NAME].aab
directly to android device because it is publishing format, but there is way to extract the required apk
from bundle
and install it to you device, the process is as follow
java -jar bundletool.jar build-apks --bundle=bundleapp.aab --output=out_bundle_archive_set.apks
out_bundle_archive_set.apks
, just rename it to out_bundle_archive_set.zip
and extract the zip file, jump into the folder out_bundle_archive_set > standalones
, where you will seee a list of all the apks There goes the reference from android developers for bundle tools link
If you want to install apk from your aab to your device for testing purpose then you need to edit the configuration before running it on the connected device.
This will install an apk directly on the device connected from the aab.
No, if you are debugging an app without other users use the Build > Build APK(s) menu in Android Studio or execute it in your device/emulator them the debug release apk will install automatically. If you are debugging an app with others use Build > Generate Signed APK... menu. If you want to publish the beta version use the Google Play Store. Your APK(s) will be in app\build\outputs\apk\debug
and app\release
folders.
Source: Stackoverflow.com