question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

apks file produced with bundletool's --local-testing flag is not installed properly

See original GitHub issue

The problem

An apks file produced with bundletool’s --local-testing flag is not installed properly.

Environment

  • Appium 1.21

Details

The official way to install an aab file with Appium is to transform it into an apks archive. If the original aab file uses dynamically loaded assets, the apks file should be created with bundletool’s --local-testing flag as per documentation.

If I understand correctly, Appium “only installs the minimum set of resources, following the behavior of the appbundle feature”. In practice it means that additional assets aren’t installed and cannot be loaded.

Android docs suggest installing apks by running bundletool install-apks, and in this case all necessary files are installed.

Thus, I wanted to:

  1. Ask whether there is a simple workaround to install the missing apks;
  2. Propose to install apks with bundletool rathen than with adb.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Sep 24, 2021

At the time we were working on this feature the functionality of bundletool was quite limited. So we had to basically mimic some of its behaviours in order to still provide features we have for vanilla .apk files. Basically, to support these dynamic resources we just need to push them to a special place, where the system could find them later (e.g. mimic the original bundle tool behaviour): https://github.com/google/bundletool/blob/a7bcb5392a2fc074fd11551b7663643d1dbb0f1d/src/main/java/com/android/tools/build/bundletool/commands/InstallApksCommand.java#L194 The list of such dynamic resources could be retrieved from the special toc file, which is also included into the apks: https://github.com/google/bundletool/blob/06296d8ec009af6ec7d09f6da2cf54994fa3a89b/src/test/java/com/android/tools/build/bundletool/testing/ApkSetUtils.java#L45

Another option would be to use bundletool as is. I assume it’s already at the stage, where we have the necessary functionality there that we previously had using vanilla adb commands.

Marking as a feature request for now. Feel free to start working on it @rg-software

0reactions
mykola-mokhnachcommented, Sep 24, 2021

The patch has been merged and published to appium@beta

Read more comments on GitHub >

github_iconTop Results From Across the Web

bundletool - Android Developers
Note: If you're using the --local-testing flag with the build-apks command, use install-apks to install your APKs to ensure that local testing ......
Read more >
Cannot install unsigned APK from debug AAB #153 - GitHub
The problem is that in order to generate the APKS and install the result, the bundletool force me to provide the --ks parameter....
Read more >
Unable to convert app bundle to APK in android - Stack Overflow
Step 1 --> Open Android Studio and Select Build. Step 2 --> Select Build Bundle/ APK Then you can see 2 Options Build...
Read more >
How To Test Android App Bundle - Appium
Since Appium 1.9.2, you can Appium tests against an .apks file using UiAutomator2 driver. ... Appium looks for bundletool.jar in your local environemnt....
Read more >
Android: Aab Bundles, install on Devices | by Leo N - Medium
Note: If you're using the --local-testing flag with the build-apks command, for local testing to work correctly, you need to use install-apks to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found