You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The path where the `apkanalyzer` binary was found, after searching it:
89
+
# - in priority in `$ANDROID_SDK_ROOT` (or `$ANDROID_HOME` for legacy setups), under `cmdline-tools/latest/bin/` or `cmdline-tools/tools/bin`
90
+
# - and falling back by trying to find it in `$PATH`
91
+
#
92
+
# @return [String] The path to `apkanalyzer`
93
+
# @raise [FastlaneCore::Interface::FastlaneError] if it wasn't found in any of the above tested paths.
94
+
#
79
95
deffind_apkanalyzer_binary!
80
96
apkanalyzer_bin=find_apkanalyzer_binary
81
97
UI.user_error!('Unable to find `apkanalyzer` executable in `$PATH` nor `$ANDROID_SDK_ROOT`. Make sure you installed the Android SDK Command-line Tools')ifapkanalyzer_bin.nil?
82
98
apkanalyzer_bin
83
99
end
84
100
101
+
# Add the `file-size` and `download-size` values of an APK to the helper, as reported by the corresponding `apkanalyzer apk …` commands
102
+
#
103
+
# @param [Fastlane::Helper::AppSizeMetricsHelper] helper The helper to add the metrics to
104
+
# @param [String] apkanalyzer_bin The path to the `apkanalyzer` binary to use to extract those file and download sizes from the `.apk`
105
+
# @param [String] apk The path to the `.apk` file to extract the sizes from
106
+
# @param [String] split_name The name to use for the value of the `split` metadata key in the metrics being added
# Generates all the split `.apk` files (typically one per device architecture) from a given `.aab` file, then yield for each apk produced.
117
+
#
118
+
# @note The split `.apk` files are generated in a temporary directory and are thus all deleted after each of them has been `yield`ed to the provided block.
119
+
# @param [String] aab_path The path to the `.aab` file to generate split `.apk` files for
120
+
# @yield [apk] Calls the provided block once for each split `.apk` that was generated from the `.aab`
121
+
# @yieldparam apk [String] The path to one of the split `.apk` temporary file generated from the `.aab`
122
+
#
93
123
defgenerate_split_apks(aab_path:, &block)
94
124
check_bundletool_installed!
95
125
UI.message("[App Size Metrics] Generating the various APK splits from #{aab_path}...")
0 commit comments