flutter项目用Xcode打开

1、在appStore下载Xcode,安装Xcode

2、接受证书 sudo xcodebuild -license 

3、选择ios模拟器,点击运行,提示需要安装cocoapods,

4、安装cocoapods,执行两个命令

brew install cocoapods
pod setup

5、执行第一个命令,报错,需要先安装Homebrew,

6、安装Homebrew,在终端执行(终端位置:Mac启动台 — 其他 — 终端)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

报错:

情况1、

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Operation timed out

情况2、

curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443

统一用一种方法解决:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

这个有中文,按照提示一步步操作,Homebrew操作成功

7、执行:brew install cocoapods

8、执行:pod setup

再点击运行!

参考:

1、Flutter Warning: CocoaPods not installed. Skipping pod install._yechaoa-CSDN博客

2、MacOS 10.15.x 新安装cocoapods-2020.12月_句号君。的博客-CSDN博客

3、curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443 - 简书

二、运行

pod Install

1、打开终端(终端是个应用,位置:启动台 — 其他 — 终端)

2、cd到你的flutter项目盘符,然后继续cd进入ios

3、然后执行 pod Install

4、完成之后运行

Android studio中也能直接将项目运行在iOS设备上,运行的时候会有个iproxy的程序弹出询问安装,允许一下iproxy的程序运行就可以了。

猜你喜欢

转载自blog.csdn.net/LoveShadowing/article/details/121182054