Flutter项目ios真机调试

6,385 阅读1分钟

最近正在捣鼓flutter,因为某些功能要真机才能调试,所以说一下关于ios真机调试上我遇到的一些小问题。

 首先得有一个flutter项目,一部iphone,安装好了xcode。

1. 打开xcode,运行我们的flutter项目,首次选择我们的手机点击调试

No Provisioning Profile was found for your project's Bundle Identifier or your
device. You can create a new Provisioning Profile for your project in Xcode for
your team by:
1- Open the Flutter project's Xcode target with
open ios/Runner.xcworkspace
2- Select the 'Runner' project in the navigator then the 'Runner' target
in the project settings
3- In the 'General' tab, make sure a 'Development Team' is selected.

我大概复制了一下,上面的报错信息。意思其实就是我们需要给这个项目选择一个team

2. 打开Xcode --> Preferences --> Accounts 新增我们的AppleId


我已经添加过了,所以显示有一个了,一般没添加的话这里是空的,点击添加一个AppleId即可


3. 之后重新运行会弹窗一个错误

ios:xcode提示“codesign想要访问您的钥匙串中的密钥“

我们打开应用程序的 “钥匙串访问”,允许程序访问



最后重启一下XCode即可成功运行。

4. 如果遇到 不受信任的开发者 问题

打开设置 --> 通用 --> 描述文件与设备管理 --> 选择描述文件 选择信任就可以进行调试啦