赞
踩
brew tap dart-lang/dart
brew install dart
export PATH="$PATH:/Users/wlm/workspace/development/flutter/bin"
通过下面两个命令验证PATH环境变量是否添加成功:
echo $PATH
which flutter
flutter create my_app
cd my_app
flutter run
报错:
Multiple devices found:
macOS (desktop) • macos • darwin-x64 • macOS 12.1 21C52 darwin-x64
Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.124
[1]: macOS (macos)
[2]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1
Launching lib/main.dart on macOS in debug mode...
ProcessException: Process exited abnormally:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH
Command: xcrun xcodebuild -list -project Runner.xcodeproj
这是因为Mac电脑没有Xcode,安装后再次运行,出现下面的提示:
Building flutter tool...
Multiple devices found:
macOS (desktop) • macos • darwin-x64 • macOS 12.1 21C52 darwin-x64
Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.124
[1]: macOS (macos)
[2]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1
Running "flutter pub get" in my_app... 505ms
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Syncing files to device macOS... 152ms
Flutter run key commands.
r Hot reload. 声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/728568
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。