Flutter 如何用 AndroidStudio 连接 iOS 虚拟机

1,683 阅读1分钟

使用如下命令监测 flutter 的相关配置:

flutter doctor

然后会显示相关的监测结果,比如:

[✓] Flutter (Channel unknown, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
   ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✗] Xcode - develop for iOS and macOS
   ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
     Download at: https://developer.apple.com/xcode/download/
     Or install Xcode via the App Store.
     Once installed, run:
       sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
       sudo xcodebuild -runFirstLaunch

可以看到 Xcode 前面有个 x,它提示你需要先安装 Xcode,然后执行以下命令:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

然后就可以发现 as 已经可以连接上 iOS 虚拟机了。