美文网首页
2019-12-02 flutter的环境配置

2019-12-02 flutter的环境配置

作者: 运琴的简书 | 来源:发表于2019-12-02 11:22 被阅读0次
      Flutter是谷歌的移动UI框架,可以快速在iOS和Android上构建高质量的原生用户界面。 Flutter可以与现有的代码一起工作。在全世界,Flutter正在被越来越多的开发者和组织使用,并且Flutter是完全免费、开源的。下面是正对MAC pro进行的环境配置。使用flutter的优势:
    

    ·跨平台: 现在Flutter至少可以跨4种平台,甚至支持嵌入式开发。我们常用的有 Linux、Android、IOS,甚至可以在谷歌最新的操作系统上 Fuchsia 进行运行。到目前为止,Flutter算是支持平台最多的框架了,良好的跨平台性,直接带来的好处就是减少开发成本。
    ·原生用户界面: 它是原生的,让我们的体验更好,性能更好。用官方的话讲就是平滑而自然的滑动效果和平台感知,为您的用户带来全新的体验。
    ·开源免费: 这个不用多说,我们只要学会并使用,这些都是免费的。这对于大公司是非常必要的,有人说你可以用破解版什么的....

     1.flutter中文网 https://flutterchina.club/get-started/install/ 
    

    环境的配置,先去flutter官网去下载对应的平台的flutter sdk,然后解压生成的flutter文件放入 应用文件 中。然后打开终端进行环境配置。

    1. cd ~/development
      2.vim ~/.bash_profile
      3.编辑.bash_profile文件, 输入 I 进入编辑状态
      export PATH=$PATH:/Applications/flutter/bin
      esc+:wq 然后点击enter键保存退出。
      4.进入终端输入: source ~/.bash_profile
      5.flutter help (有很多关于flutter的帮助语句出现,说明咋们的flutter的 SDK已经安装成功了)!!!!
      6.flutter doctor  -> 看是否还有其他的依赖项需要安装。
      [✗] Android toolchain - develop for Android devices
      ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/setup/#android-setup for detailed
      instructions).
      If the Android SDK has been installed to a custom location, set
      ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.

    [!] 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
    前面打X的都是你现在的电脑环境需要安装的。
    这里说明我需要配置Android SDK,和xcode的安装。
    3.sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    已经安装了xcode,则配置对应路径下的xcode进行配置。
    4.sudo xcodebuild -license 允许许可。space键确定
    5.open -a Simulator 设置iOS模拟器

    6.打包 flutter build 命令说明,
    flutter build ios 生成iOS ipa包
    flutter build apk 生成apk包
    但是两个的生成路径不一样,iOS是在flutter工程文件下的build->ios->iphoneos/Runner.app
    apk包在build->app->outputs->apk->release->app-release.apk

    相关文章

      网友评论

          本文标题:2019-12-02 flutter的环境配置

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