Describe the bug
I've referred Google IO'18 official session youtube video: https://youtu.be/bViNOUeFuiQ?t=1324 and it says that you can generate the apk set archive for the connected device from the app bundle during testing phase.
I'm trying to run the following command which should generate the apk set for connected device or as per the device-specs. These both commands are not working and giving me the following error.
bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --connected-device
bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --device-spec=pixel2.json
Bundletool version(s) affected
Version: [e.g. 0.3.3]
Stacktrace
$ bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --connected-device
WARNING: The APKs won't be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information.
[BT:0.3.3] Error: Unrecognized flags: --connected-device
com.android.tools.build.bundletool.utils.flags.ParsedFlags$UnknownFlagsException: Unrecognized flags: --connected-device
at com.android.tools.build.bundletool.utils.flags.ParsedFlags.checkNoUnknownFlags(ParsedFlags.java:90)
at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:239)
at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:191)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:72)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44)
$ bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --device-spec=pixel2.json
WARNING: The APKs won't be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information.
[BT:0.3.3] Error: Unrecognized flags: --device-spec
com.android.tools.build.bundletool.utils.flags.ParsedFlags$UnknownFlagsException: Unrecognized flags: --device-spec
at com.android.tools.build.bundletool.utils.flags.ParsedFlags.checkNoUnknownFlags(ParsedFlags.java:90)
at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:239)
at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:191)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:72)
at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:44)
To Reproduce
Steps to reproduce the behavior.
- Use the above-mentioned command to install the application to the connected device.
bundletool build-apks --bundle=app/build/outputs/bundle/debug/bundle.aab --output=my_app.apks --connected-device
Expected behavior
It should generate the apk archive set for the connected device or as per the device spec json file.
Known workaround
Don't know
Environment:
OS: MAC, High Sierra 10.13.4
Device : Pixel2 XL