How to generate Arm64 Apk file with expo like react native Android/apps/buil/outputs/apk

I am suffering from the app size. Eas creates a great app for google play that is compatible with every phone. Idont want this. How can I create a small apk that is compatible only with my phone? Screenshot_1

build aab instead, file size will be the same as apk but google will repackage it into a separate apk per architecture

1 Like

I have a console account, but I don’t want to install the application on google play. Can I do this without installing? this is a special app for me

If it’s just for internal use, does the size matters?

To answer your question:

The other option is to build aab for all platforms and generate apk form it for single platform with bundletool

1 Like

To elaborate on the bundletool option, you would need to do something like this. In all of the commands below, /MyApp/... is just a path where you have the .aab or keystore or where you want to generate the APKs:

Build the .aab
Fetch Expo credentials using expo credentials:manager or eas credentials
Run bundletool to generate a set of APKs using the .aab and the credentials:

$ bundletool build-apks --bundle=/MyApp/my_app.aab \
  --output=/MyApp/my_app.apks \
  --ks=/MyApp/keystore.jks \
  --ks-pass=file:/MyApp/keystore.pwd \
  --ks-key-alias=MyKeyAlias \

(If you use a command like the above you’ll need to store the keystore/key passwords in the .pwd files. Alternatively you can use pass:the_password instead of file:/path/to/password/file)

You can also generate a set of APKs specific to your device. Something like this, although I can’t remember if I’ve ever actually tried doing it this way:

Generate a set of APKs for the connected device. I think you would still need to specify the keystore/credentials options:

$ bundletool build-apks --connected-device --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks

Generate and use device specification JSON files. Again, I think you’ll need to specify the keystore/credentials options:

$ bundletool get-device-spec --output=/tmp/device-spec.json
$ bundletool build-apks --device-spec=/MyApp/device-spec.json --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks

Then you install them like this:

$ bundletool install-apks --apks=/MyApp/my_app.apks
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.