美文网首页
mac搭建Flutter,已经xcode运行flutter项目

mac搭建Flutter,已经xcode运行flutter项目

作者: 天涯火花 | 来源:发表于2024-01-04 14:40 被阅读0次

1.下载flutterSDK:直接cd到希望存储的文件夹,然后直接使用git clone 的方式直接下载master分支上的代码
git clone -b stable https://github.com/flutter/flutter.git

2.配置flutter的环境变量
(1)open ~/.zshrc
(2)export PATH=/{sdkPath}/bin:PATH //需要写自己的路径
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
(3)source ~/.bash_profile

3.运行flutter doctor查看是否安装成功
4.配置 flutter ios 的环境
brew update
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup

  1. flutter create 脚手架命令来创建第一个 应用,
    sudo flutter create flutter_glaxy //项目名字

    6.给刚刚创建好的 flutter “文件夹” 和 “ 对应的SDK”都赋予权限 sudo chmod -R 777 * image.png
    7.运行flutter项目
    flutter run 运行项目

    r键 重新加载
    p键 显示网格
    o键 切换安卓和iOS
    q键 退出调试预览模式

相关文章

网友评论

      本文标题:mac搭建Flutter,已经xcode运行flutter项目

      本文链接:https://www.haomeiwen.com/subject/cnonkrtx.html