You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Norman Breau <no...@normanbreau.com> on 2019/08/12 12:34:35 UTC

[DISCUSS] Replacing ADB usage in favour for using BundleTools

Hi all,

Just throwing a potential idea out there, maybe for the cordova-android 
9.x milestone. Now that we have android bundle support merged into 
master, I think it is worth considering to incorporate bundletool, which 
is a command line toolset for managing and manipulating AAB files. It is 
the underlying command tool that Google uses for Gradle, Android Studio, 
and Google Play service. It is released under the Apache license. I 
believe it can for the most part replace ADB usage, because it can both 
build apks, and deploy apks to device.

One benefit this will provide us is we can then support the cordova run 
command while using bundles since the bundletool itself can install apk 
generated from the bundle to a connected device.

I think there might be some cases where using the ADB executable is 
still necessary, perhaps for listing devices, etc. But for actual 
building/installing a build to the device, I believe ADB can be replaced 
with the bundletool.

We can still provide an APK to those end-users who still wants to use 
APKs for deployment as we can extract APKs from a bundle.

I'll provide couple links for reference:
https://developer.android.com/studio/command-line/bundletool

https://github.com/google/bundletool

- Norman


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: [DISCUSS] Replacing ADB usage in favour for using BundleTools

Posted by Norman Breau <no...@normanbreau.com>.
As of right now, it isn't included as part of the Android SDK. It needs 
to be downloaded from their github repository. So cordova will have to 
download this manually and store it somewhere where it can be executed. 
It's a jar file, but java is already a dependency of the android sdk 
anyway. I can't imagine that older android versions will be a problem 
here, but I agree, testing should be done during implementation.

Further reading, it sounds like you can build a bundle file. From a 
bundle file, you can generate an "apks" (APK Set) file, from which we 
can extract specific APKs from. An Apk set is a special binary file 
containing thousands of APKs, with different configurations, for 
different cpu architectures, for different screen sizes, etc. bundletool 
can determine which APK specifically is best for your device.

Additionally, it supports a --mode=universal flag, which is basically 
the equivalent apk that we would get from a basic build config. I 
imagine that we can use this flag to support providing a "legacy" style 
apk if necessary... Google provides a notice that this mode is useful if 
you want to internally share an APK to testers that have different 
device configurations.

- Norman

On 2019-08-12 12:25 p.m., Jan Piotrowski wrote:
> Sounds great. Historically we always had trouble when Google decided
> to replace/deprecate/change any of the tools in the build toolchain,
> so keeping up to date what is the tool of the week sounds like a good
> idea.
>
> Important to consider is the availability of that tool for older
> Android versions, on CI providers etc. But I expect that to be part of
> the implementation work.
>
> -J
>
> Am Mo., 12. Aug. 2019 um 14:34 Uhr schrieb Norman Breau
> <no...@normanbreau.com>:
>> Hi all,
>>
>> Just throwing a potential idea out there, maybe for the cordova-android
>> 9.x milestone. Now that we have android bundle support merged into
>> master, I think it is worth considering to incorporate bundletool, which
>> is a command line toolset for managing and manipulating AAB files. It is
>> the underlying command tool that Google uses for Gradle, Android Studio,
>> and Google Play service. It is released under the Apache license. I
>> believe it can for the most part replace ADB usage, because it can both
>> build apks, and deploy apks to device.
>>
>> One benefit this will provide us is we can then support the cordova run
>> command while using bundles since the bundletool itself can install apk
>> generated from the bundle to a connected device.
>>
>> I think there might be some cases where using the ADB executable is
>> still necessary, perhaps for listing devices, etc. But for actual
>> building/installing a build to the device, I believe ADB can be replaced
>> with the bundletool.
>>
>> We can still provide an APK to those end-users who still wants to use
>> APKs for deployment as we can extract APKs from a bundle.
>>
>> I'll provide couple links for reference:
>> https://developer.android.com/studio/command-line/bundletool
>>
>> https://github.com/google/bundletool
>>
>> - Norman
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Re: [DISCUSS] Replacing ADB usage in favour for using BundleTools

Posted by Jan Piotrowski <pi...@gmail.com>.
Sounds great. Historically we always had trouble when Google decided
to replace/deprecate/change any of the tools in the build toolchain,
so keeping up to date what is the tool of the week sounds like a good
idea.

Important to consider is the availability of that tool for older
Android versions, on CI providers etc. But I expect that to be part of
the implementation work.

-J

Am Mo., 12. Aug. 2019 um 14:34 Uhr schrieb Norman Breau
<no...@normanbreau.com>:
>
> Hi all,
>
> Just throwing a potential idea out there, maybe for the cordova-android
> 9.x milestone. Now that we have android bundle support merged into
> master, I think it is worth considering to incorporate bundletool, which
> is a command line toolset for managing and manipulating AAB files. It is
> the underlying command tool that Google uses for Gradle, Android Studio,
> and Google Play service. It is released under the Apache license. I
> believe it can for the most part replace ADB usage, because it can both
> build apks, and deploy apks to device.
>
> One benefit this will provide us is we can then support the cordova run
> command while using bundles since the bundletool itself can install apk
> generated from the bundle to a connected device.
>
> I think there might be some cases where using the ADB executable is
> still necessary, perhaps for listing devices, etc. But for actual
> building/installing a build to the device, I believe ADB can be replaced
> with the bundletool.
>
> We can still provide an APK to those end-users who still wants to use
> APKs for deployment as we can extract APKs from a bundle.
>
> I'll provide couple links for reference:
> https://developer.android.com/studio/command-line/bundletool
>
> https://github.com/google/bundletool
>
> - Norman
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org