wuxiaolong@WuXiaolongs-MacBook-Pro flutter_andblog % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel master, 1.24.0-8.0.pre.147, on macOS 11.0.1 20B29 darwin-x64, locale zh-Hans-CN) [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] Xcode - develop for iOS and macOS (Xcode 12.2) [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] IntelliJ IDEA Ultimate Edition (version 2017.3.5) [✓] Connected device (4 available) ! Doctor found issues in 1 category.
step2 连接手机
将 iPhone 连接到电脑,Android Studio 上面会显示你的真机,选择你的真机设备,准备运行。
Could not run build/ios/iphoneos/Runner.app on 2060bf844. Try launching Xcode and selecting "Product > Run" to fix the problem: open ios/Runner.xcworkspace
Error launching application on iPhone.
再打开,提示“In iOS 14+,debug mode Flutter apps can only be launched from Flutter tooling,IDEs with Flutter plugins or from Xcode.Alternatively,build in profile or release modes to enable launching from the home screen.”,意思要使用 Xcode,第一次运行就报了以上错误,没在意,我点击了错误信息“ios/Runner.xcworkspace”,点击运行,握草,成功了。
之后发现直接在 Android Studio 运行也可以,如果把 APP 后台杀掉,打开应用又会提示“In iOS 14+,debug mode Flutter apps can only be launched from Flutter tooling……”,毕竟是免费开发者,调试够了。