dev/flutter
flutter - 앱 빌드 사이즈 확인
wlrn566
2023. 7. 14. 13:45
1. 사이즈 분석
flutter build appbundle(또는 apk) --analyze-size
>> Cannot perform code size analysis when building for multiple ABIs. Specify one of android-arm, android-arm64, or android-x64 in the --target-platform flag.
# 타겟 명시
flutter build appbundle --analyze-size --target-platform android-arm64
분석 완료와 함께 json 파일이 만들어진다.
2. devtool 실행
# tools 리스트 확인
flutter pub global list
# 있다면 이름과 버전뜸
# 없으면 안뜸
# 없으면 활성화
flutter pub global activate devtools
# 비활성화 시
flutter pub global deactivate devtools
# devtools 실행
flutter pub global run devtools
127.0.01:9102/#/ 이라는 창이 열린다.
3. 파일 분석
open app size tool 클릭
분석 후 나온 json 파일 넣기
/User/사용자명/.flutter-devtools 폴더 내에 위치해있다.