如何在 iOS 上将 flutter 的“--obfuscate”标志与 fastlane 一起使用

Roh*_*eja 8 ios fastlane flutter fastlane-gym

gym我有一个 fastlane 通道,可以使用或构建应用程序build_app,但我也想使用flutter build's--obfuscate标志。

  desc "Build - Enterprise"
  lane :build_enterprise do |options|
    bundle_id = options[:bundle_id]

    sync_certificates_and_provisioning_profiles(
      type: "enterprise",
      bundle_id: bundle_id,
    )
    cleanup
    gym(
      scheme: get_scheme(bundle_id),
      export_method: "enterprise",
      clean: true,
      include_bitcode: false,
      include_symbols: true,
      export_options: {
        signingStyle: "manual",
        provisioningProfiles: generate_enterprise_profiles(bundle_id)
      }
    )
  end
Run Code Online (Sandbox Code Playgroud)

据我了解,我可以替换gymflutter build ios --obfuscate,但是我如何利用gym提供的其他参数。例如:export_methodexport_optionsinclude_bitcodeinclude_symbols?我的应用程序有多种风格,并且基于调试/发布应用程序或登台/生产应用程序使用这些参数非常有用。

小智 1

您无法通过 fastlane-gym 添加此功能。在project_directory>iOS>Flutter>Generated.xcconfig文件中添加

DART_OBFUSCATION=true
Run Code Online (Sandbox Code Playgroud)