dotnet not generating unsigned apk

106 Views Asked by At

I have a Xamarin project which we are upgrading to MAUI which gets released to clients in 2 ways:

  1. Playstore
  2. MDM Servers

Some of our clients use there own MDM servers over which we do not have any control. All we do for them is give them an apk file.

MAUI recommends AAB format over APK for distribution through playstore.

My build command looks like this:

dotnet publish "MyApp.sln" -f net7.0-android -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="$SourceRoot/myapp.keystore" -p:AndroidSigningKeyAlias="MyAppKeyStore" -p:AndroidSigningKeyPass="androidKeyPass" -p:AndroidSigningStorePass="androidStorePass" -p:OutputPath="androidOutputPath" || exit 1

This is creating 3 output artefacts: a myapp.aab, myapp-signed.aab and myapp-signed.apk

Previously, we used to run zipalign on the generated apk before signing it to optimize the apk. And then send it to MDM clients.

However, I do not have an unsigned apk here on which I can run zipalign and then sign and send it to clients.

How do I generate both an unsigned apk using my existing build command? The command should ideally generate 4 output files: signed and unsigned AAB, signed and unsigned APK.

I tried adding -p:AndroidPackageFormats="apk;aab;" but it seems it can only accept one value viz. either apk or aab. Not both.

0

There are 0 best solutions below