本节目标
- 安装 xcode
- 配置 flutter 连接 xcode
- 在 IOS 模拟器中运行 flutter app
1. 安装 XCode
安装 Xcode 9.0 以上版本 (访问 Apple网站 下载或者,Mac App Store 方式安装).
2. 第一次启动 XCode 安装所需组件

3. 配置 Xcode command-line tools
1 | > sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer |
4. 启动模拟器
1 | open -a Simulator |
5. 创建 Flutter 项目
5.1 create & run
1 | > flutter create my_app |

模拟器运行
5.2 vm 报告
1 | http://127.0.0.1:62341/ztmtijcoJrI=/#/vm |

vm
6. 部署到真机
6.1 安装软件包
1 | > brew update |
安装 homebrew
pod setup 很慢的问题
- 手动下载 git clone https://github.com/CocoaPods/Specs
- 复制 ~/.cocoapods/repos/Specs-master
- 执行 pod update
- 复制 master 下的 .git 到 Specs-master
- 停止 pod update
- 重命名 Specs-master 为 master
- 进入项目的 ios 目录下 pod install 成功
6.2 配置AppStore开发者账号
1 | open ios/Runner.xcworkspace |

Add Account
参考
© 猫哥