flutter-reducing-app-size by flutter/skills
npx skills add https://github.com/flutter/skills --skill flutter-reducing-app-size--analyze-size 标志会生成一个 *-code-size-analysis_*.json 文件,详细说明包、库、类和函数的字节大小。使用此工作流生成体积分析所需的原始数据。
任务进度:
--analyze-size 标志的 Flutter 构建命令。build/ 目录中找到生成的 文件。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
*-code-size-analysis_*.json条件逻辑:
flutter build apk --analyze-size 或 flutter build appbundle --analyze-size。flutter build ios --analyze-size。注意:这会创建一个 .app 文件,可用于相对内容大小分析,但不能用于估算最终的 App Store 下载大小。请使用“估算 iOS 下载大小”工作流来获取准确的 iOS 指标。flutter build [windows|macos|linux] --analyze-size。使用此工作流来可视化和深入分析体积分析 JSON 数据。
任务进度:
dart devtools 以启动 DevTools。*-code-size-analysis_*.json 文件。使用此工作流来准确预估 iOS 应用在不同设备上的下载和安装大小。
任务进度:
pubspec.yaml 中配置应用版本和构建号。flutter build ipa --export-method development 生成 Xcode 归档文件。App Thinning Size Report.txt 文件以评估每个设备的预估大小。应用这些策略来主动减少应用程序的编译体积。
任务进度:
pubspec.yaml 和 assets/ 目录。删除代码库中未主动引用的任何图片、字体或文件。pngquant、imageoptim 或 WebP 转换等工具对其进行压缩。# 为 Android App Bundle 生成体积分析 JSON
flutter build appbundle --analyze-size --target-platform=android-arm64
# 构建 APK 时剥离调试信息以减少二进制文件大小
flutter build apk --obfuscate --split-debug-info=build/app/outputs/symbols
查看 App Thinning Size Report.txt 时,寻找特定的目标设备以了解对用户的真实影响:
Variant: Runner-7433FC8E-1DF4-4299-A7E8-E00768671BEB.ipa
Supported variant descriptors: [device: iPhone12,1, os-version: 13.0]
App + On Demand Resources size: 5.4 MB compressed, 13.7 MB uncompressed
App size: 5.4 MB compressed, 13.7 MB uncompressed
解读:最终用户下载大小是 5.4 MB,设备上占用空间是 13.7 MB。
每周安装量
1.8K
代码仓库
GitHub 星标数
784
首次出现
11 天前
安全审计
安装于
codex1.7K
gemini-cli1.7K
opencode1.7K
github-copilot1.7K
cursor1.7K
kimi-cli1.7K
--analyze-size flag generates a *-code-size-analysis_*.json file detailing the byte size of packages, libraries, classes, and functions.Use this workflow to generate the raw data required for size analysis.
Task Progress:
--analyze-size flag.*-code-size-analysis_*.json file in the build/ directory.Conditional Logic:
flutter build apk --analyze-size or flutter build appbundle --analyze-size.flutter build ios --analyze-size. Note: This creates a.app file useful for relative content sizing, but not for estimating final App Store download size. Use the Estimating iOS Download Size workflow for accurate iOS metrics.flutter build [windows|macos|linux] --analyze-size.Use this workflow to visualize and drill down into the Size Analysis JSON.
Task Progress:
dart devtools in the terminal.*-code-size-analysis_*.json file.Use this workflow to get an accurate projection of iOS download and installation sizes across different devices.
Task Progress:
pubspec.yaml.flutter build ipa --export-method development.build/ios/archive/*.xcarchive) in Xcode.App Thinning Size Report.txt file to evaluate projected sizes per device.Apply these strategies to actively reduce the compiled footprint of the application.
Task Progress:
pubspec.yaml and assets/ directory. Delete any images, fonts, or files not actively referenced in the codebase.pngquant, imageoptim, or WebP conversion before bundling them into the app.# Generate the size analysis JSON for an Android App Bundle
flutter build appbundle --analyze-size --target-platform=android-arm64
# Build an APK while stripping debug info to reduce binary size
flutter build apk --obfuscate --split-debug-info=build/app/outputs/symbols
When reviewing App Thinning Size Report.txt, look for the specific target device to understand the true impact on the user:
Variant: Runner-7433FC8E-1DF4-4299-A7E8-E00768671BEB.ipa
Supported variant descriptors: [device: iPhone12,1, os-version: 13.0]
App + On Demand Resources size: 5.4 MB compressed, 13.7 MB uncompressed
App size: 5.4 MB compressed, 13.7 MB uncompressed
Interpretation: The end-user download size (compressed) is 5.4 MB, and the on-device footprint (uncompressed) is 13.7 MB.
Weekly Installs
1.8K
Repository
GitHub Stars
784
First Seen
11 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex1.7K
gemini-cli1.7K
opencode1.7K
github-copilot1.7K
cursor1.7K
kimi-cli1.7K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装