Skip to content

WIP: Tests for the android-release-symbols branch #4227

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

Draft
wants to merge 1 commit into
base: android-release-symbols
Choose a base branch
from

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented May 28, 2025

Tests to complete #4221:

Ideally we'd find a way to test this properly, since it snuck through our existing tests. I spent some time investigating a way to use the bundletool to split the AAB into device specific APKs (mimicking what happens when installing the app on a device)... and this might work but there are some subtleties/complexities.

When our current tests are running on an actual Android Device, they just get an Assembly Reader for the currently running application:

#if ANDROID
var logger = new TestOutputDiagnosticLogger(_output);
return AndroidHelpers.GetAndroidAssemblyReader(logger)!;
#else

I would expect, for a release build, that we would see the behaviour we see when running Sentry.Samples.Maui to a simulator in release mode... but we don't. So I'm guessing xharness takes some shortcuts or hosts the test app slightly differently. At the very least then, if we built some tests like this (using split APKs from the bundletool) we'd have to disable them when running on an Android device.

Also the bundle tool outputs a single *.apks file (APK Set). It's basically a zip and we can unpack it and it contains three files:

  • toc.pb
  • splits/base-master.apk
  • splits/base-x86_64.apk

Curiously, these are not named base.apk and split_config.x86_64.apk... which is what I'm seeing when an app is actually installed on a device/simulator.

All in all, I wasn't building a lot of confidence that the tests were going to be useful... but this PR contains the preliminary work - build targets that use the bundletool to split the APKs.

#skip-changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant