Flutter教程:Macos安装与配置

安装和配置步骤

  • (1) 下载SDK,我习惯使用git直接下载
git clone https://github.com/flutter/flutter.git -b stable
  • (2) 打开配置文件,看使用的是啥bash,找到对应配置文件即可
$HOME/.bash_profile
$HOME/.bashrc
$HOME/.zshrc #我修改的这个,详情看文末附录
  • (3) 加入到到环境变量中,[PATH_OF_FLUTTER_GIT_DIRECTORY] t要改成sdk的bin路径
export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
  • (4) 使用source时配置立即生效
 source $HOME/.<rc file>
  • (5) 确认一下环境变量是否导入成功且有效
echo $PATH
  • (6) 再确认一下flutter的路径
which flutter

(7)使用doctor来诊断一下环境是否正常

flutter doctor
[!] Xcode - develop for iOS and macOS
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.

使用命令安装一下:sudo gem install cocoapods

附录

.zshrc 
# color term like 'ls'
export CLICOLOR='Yes'
# custom shell prompt
autoload -U colors && colors
PROMPT="%{$fg[green]%}%n@%m%{$reset_color%} %{$fg[blue]%}%1~%{$reset_color%} %# "

# self defined aliases
alias ll='ls -l'
alias la='ls -a'

#flutter configue
export PATH=/Users/uianster/learn/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
source ~/.bash_profile

参考:
https://flutter.dev/docs/get-started/install/macos

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Title: Xcode 5 Start to Finish: iOS and OS X Development Author: Fritz Anderson Length: 624 pages Edition: 1 Language: English Publisher: Addison-Wesley Professional Publication Date: 2014-05-16 ISBN-10: 0321967208 ISBN-13: 9780321967206 Use Xcode 5 to Write Great iOS and OS X Apps! Xcode 5 Start to Finish will help you use the tools in Apple’s Xcode 5 to improve productivity, write great code, and leverage the newest iOS 7 and OS X Mavericks features. Drawing on thirty years of experience developing for Apple platforms and helping others do so, Fritz Anderson shows you a complete best-practice Xcode workflow. Through three full sample projects, you’ll learn to integrate testing, source control, and other key skills into a high-efficiency process that works. Anderson shows you better ways to storyboard, instrument, build, and compile code, and helps you apply innovations ranging from Quick Look to Preview Assistant. By the time you’re finished, you’ll have the advanced Xcode skills to develop outstanding software. Coverage includes Setting breakpoints and tracing execution for active debugging Creating libraries by adding and building new targets Integrating Git or Subversion version control Creating iOS projects with MVC design Designing Core Data schemas for iOS apps Linking data models to views Designing UI views with Interface Builder Using the improved Xcode 5 Autolayout editor Improving reliability with unit testing Simplifying iOS provisioning Leveraging refactoring and continual error checking Using OS X bindings, bundles, packages, frameworks, and property lists Localizing your apps Controlling how Xcode builds source code into executables Analyzing processor and memory usage with Instruments Integrating with Mavericks Server’s sleek continuous integration system Register your book at www.informit.com/register for access to this title’s downloadable code. Table of Contents Part I First Steps Chapter 1 Getting Xcode Chapter 2 Kicking The Tires Chapter 3 Simple Workflow And Passive Debugging Chapter 4 Active Debugging Chapter 5 Compilation Chapter 6 Adding A Library Target Chapter 7 Version Control Part II The Life Cycle Of An Ios Application Chapter 8 Starting An Ios Application Chapter 9 An Ios Application: Model Chapter 10 An Ios Application: Controller Chapter 11 Building A New View Chapter 12 Autolayout In A New View Chapter 13 Adding Table Cells Chapter 14 Adding An Editor Chapter 15 Unit Testing Chapter 16 Measurement And Analysis Chapter 17 Provisioning Part III Xcode For Mac Os X Chapter 18 Starting An Os X Application Chapter 19 Bindings: Wiring An Os X Application Chapter 20 A Custom View For Os X Chapter 21 Localization Chapter 22 Bundles And Packages Chapter 23 Frameworks Chapter 24 Property Lists Part IV Xcode Tasks Chapter 25 Documentation In Xcode Chapter 26 The Xcode Build System Chapter 27 Instruments Chapter 28 Debugging Chapter 29 Continuous Integration Chapter 30 Snippets Part V Appendixes Appendixe A Some Build Variables Appendixe B Resources

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值