Flutter--엔진 컴 파일

4281 단어 flutter
  • terminal 이동 대리 유량 확보
  • git config--global http.proxy"localhost:port"를 사용 하여 프 록 시 를 설정 합 니 다.

  • port 는 포트 번호 입 니 다.서로 다른 것 에 따라 저 는 lartern 을 사용 하고 포트 는 50321 입 니 다.
  • git config--global http.proxy"localhost:50321"의 구체 적 인 포트 번 호 는 소프트웨어 의 관련 설정 에 따라
    git config --global https.proxy http://127.0.0.1:1080
    git config --global https.proxy https://127.0.0.1:1080
    git config --global http.proxy 'socks5://127.0.0.1:1080' 
    git config --global https.proxy 'socks5://127.0.0.1:1080'
    //  
    git config --global --unset http.proxy
    git config --global --unset https.proxy
  • depot 설정툴 툴
    depot_tools 는 gclient,gn,ninja 등 도구 패키지 입 니 다.Google 이 Chromium 소스 코드 관리 문 제 를 해결 하기 위해 Chromium 에 제공 하 는 소스 코드 관리 도구 입 니 다.Flutter 소스 코드 동기 화 도 depot 에 의존 해 야 합 니 다.도구
    //clone depot_tools  
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    
    // depot_tools      
    export PATH="$PATH:/path/to/depot_tools"
    
    //      
    https://dev.chromium.org/developers/how-tos/depottools
    https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.htm

    원본 코드 다운로드
  • 홈 페이지 fork 공사 부터 자체 공사 까지https://github.com/flutter/engine
  • ssh 비밀 키 설정https://help.github.com/artic...
  • engine 디 렉 터 리 에.gclient 파일 을 만 들 면 원본 코드 동기 화
    solutions = [
      {
        "managed": False,
        "name": "src/flutter",
        "url": "[email protected]:chiqtv/engine.git",
        "custom_deps": {},
        "deps_file": "DEPS",
        "safesync_url": "",
      },
    ]
  • 동기 코드
    cd /path/to/engine
    gclient sync //  flutter     ,      git clone     
  • 컴 파일
  • 컴 파일 옵션,./flutter/tools/gn--help 명령 으로 보기
    usage: gn [-h] [--unoptimized]
              [--runtime-mode {debug,profile,release,jit_release}] [--interpreter]
              [--dart-debug] [--full-dart-debug]
              [--target-os {android,ios,linux,fuchsia}] [--android]
              [--android-cpu {arm,x64,x86,arm64}] [--ios] [--ios-cpu {arm,arm64}]
              [--simulator] [--fuchsia] [--linux-cpu {x64,x86,arm64,arm}]
              [--fuchsia-cpu {x64,arm64}] [--arm-float-abi {hard,soft,softfp}]
              [--goma] [--no-goma] [--lto] [--no-lto] [--clang] [--no-clang]
              [--clang-static-analyzer] [--no-clang-static-analyzer]
              [--target-sysroot TARGET_SYSROOT]
              [--target-toolchain TARGET_TOOLCHAIN]
              [--target-triple TARGET_TRIPLE]
              [--operator-new-alignment OPERATOR_NEW_ALIGNMENT] [--enable-vulkan]
              [--enable-fontconfig] [--enable-skshaper]
              [--enable-vulkan-validation-layers] [--embedder-for-target]
              [--coverage] [--out-dir OUT_DIR] [--full-dart-sdk]
              [--no-full-dart-sdk] [--ide IDE] [--disable-desktop-embeddings]
              [--build-glfw-shell] [--no-build-glfw-shell] [--bitcode]
              [--stripped] [--no-stripped] [--asan] [--lsan] [--msan] [--tsan]
  • Android arm 64 의 release 최적화 판
    cd /path/to/engine/src/
      ./flutter/tools/gn --android-cpu arm64 --no-lto --runtime-mode=release
    ninja -C out/host_release_arm64 -j 8   //  Host        
      
    ./flutter/tools/gn --android --android-cpu arm64 --no-lto --runtime-mode=release 
    ninja -C out/android_release_arm64 -j 8 //  Android        
      
      
     //          ,   lto      
      https://github.com/flutter/flutter/issues/57207
    
  • Android armeabi 지원 은 Android armeabi 를 지원 하지 않 습 니 다.armeabi-v7a 를 최소 지원 합 니 다.개인 적 인 느낌 으로 볼 때 작은 공장 의 응용 개발 은 arm 64 를 지원 할 정도 로 지나 갈 것 입 니 다.arm 64 를 지원 하지 않 는 주류 플래그 십 기 는 주로 해사 935,고통 801,해사 총 950,고통 총 808 이후 arm 64 를 지원 하 는 cpu 입 니 다.
  • 컴 파일 된 flutter
    //local-engine-src-path:  Flutter        ,   src        
    //local-engine:          
  • 를 사용 합 니 다.
    flutter build apk --target-platform android-arm64 --local- engine=android_release_arm64 --local-engine-src- path=/Users/xiaoyao/Documents/code/flutter/engine/src

    좋은 웹페이지 즐겨찾기