Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy in install size #93

Open
MrHadiSatrio opened this issue Aug 19, 2022 · 3 comments
Open

Discrepancy in install size #93

MrHadiSatrio opened this issue Aug 19, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@MrHadiSatrio
Copy link
Contributor

Current behavior

There is a discrepancy in readings for install size. Running sample:app:analyzeDebug yields 620.9 KB on the report, while "App size" readings on device shows 676 KB.

Device configurations are synced with the result of bundletool get-device-spec.

Ruler Report On Device
Screen Shot 2022-08-19 at 10 39 45 Screen Shot 2022-08-19 at 10 39 45

I'm also observing a bigger diff of almost 3x (62.8 MB reported vs 192 MB on-device) on my project.

Expected behavior

There shouldn't be that big of a difference between the number Ruler reports for Install Size and the actual readings on a device.

Steps to reproduce

  1. Ensure that Ruler is properly setup to run with the target device configuration
  2. Run ./gradlew sample:app:analyzeDebugBundle
  3. Run ./gradlew sample:app:installDebug
  4. Observe the numbers reported and one from App Info screen

Versions

  • Ruler 1.3.0
  • Android Gradle Plugin 7.2.1
  • Gradle 7.5

Anything else?

No response

@MrHadiSatrio MrHadiSatrio added the bug Something isn't working label Aug 19, 2022
@simonschiller
Copy link
Collaborator

What numbers does Android Studio report when you analyze the APK files with that? I suspect that this could have something to do with the way the APK is built when you run installDebug - which might be different than the mechanism we are using (running bundleDebug, then using bundletool to extract the correct APKs and then analyzing those APKs with the APK Analyzer).

@MrHadiSatrio
Copy link
Contributor Author

Sorry for the long delay... I tried analyzing the AAB and the number matches Ruler's output. However, the APKs generated by bundletool tell a different story.

\ Ruler AAB APKs (base-master.apk + base-xxhdpi.apk)
Download Size 617.5 KB 617.8 KB 612.8 KB + 1.3 KB
Install Size 620.9 KB 620.5 KB 615.4 KB + 1.3 KB

Granted, the difference isn't that massive here. But from my findings, whatever it is the cause, it'd scale alongside the overall project size.

@simonschiller
Copy link
Collaborator

Is this reproducible in some open source project where we can try it out? It would be interesting to see the differences for each file to see if all of them are off by a little bit of if it's only a few files that have a discrepancy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants