curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- 在windows上安装编译生成库,需要安装指定版本
# 指定版本
cargo install flutter_rust_bridge_codegen --version 1.51.0 --force
- 然后重新执行生成命令
flutter_rust_bridge_codegen -r rust/src/api.rs -d lib/ffi/rust_ffi/rust_ffi.dart -c ios/Runner/bridge_generated.h -c macos/Runner/bridge_generated.h
- 编译iOS,按需执行下述命令
# 64 bit targets (真机 & 模拟器):
rustup target add aarch64-apple-ios x86_64-apple-ios
# New simulator target for Xcode 12 and later
rustup target add aarch64-apple-ios-sim