经验(Flutter项目IOS真机部署及问题)
用flutter开发ios应用在真机调试时出现的问题以及处理方式
无法连接iphone手机
flutter找不到真机,已经安装Xcode,Xcode里面可以打开真机运行,但Android Studio环境和Vscode环境下,不能找到连接的iPhone真机,其实很简单,终端运行一下:
flutter doctor
【经验(Flutter项目IOS真机部署及问题)】即可,控制台提示如下:
文章图片
image-20190104201612194 按照提示终端执行 截图绿色部分的命令即可。
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
Signing for "xxx" requires a development team. Select a development team 首次用vscode连上真机以后,点击调试,会出现如下问题:
No Provisioning Profile was found for your project's Bundle Identifier or your用xcode打开 flutter项目
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.
You may need to:
- Log in with your Apple ID in Xcode first - Ensure you have a valid unique Bundle ID - Register your device with your Apple Developer Account - Let Xcode automatically provision a profile for your app
4- Build or run your project again
It's also possible that a previously installed app with the same Bundle
Identifier was signed with a different certificate.
For more information, please visit:
https://flutter.io/setup/#deploy-to-ios-devices
Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
2018-10-27 12:09:29.004 ios-deploy[91734:221562][ !! ] Error 0xe8008015: A valid provisioning profile for this executable was not found. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
Could not install build/ios/iphoneos/Runner.app on b53d6902af4ac5d5166a3125b9013886739c92d2.
Try launching Xcode and selecting "Product > Run" to fix the problem:
open ios/Runner.xcworkspace
Error launching application on xxx的 iPhone.
Exited (sigterm)
/ios/Runner.xcworkspace
这个文件,好,我们手动打开,点击编译,此时会编译不通过~出现这个问题的原因是你的xcode project 中的team没有选择,选择方法如下。
文章图片
img 不受信任的开发者 解决方式:打开手机上的"设置->通用->设备管理->开发者应用",进入以后,点击"信任 xxxxx@xxx.com"
参考链接 官方链接:https://flutter.io/docs/get-started/install/macos
我的博客:https://meandni.com/2019/01/04/5671/
推荐阅读
- 17|17 关山松 第二课作业#公众号项目# D20
- RxJava|RxJava 在Android项目中的使用(一)
- Hacking|Hacking with iOS: SwiftUI Edition - SnowSeeker 项目(一)
- 靠QQ月入上万灰色暴利偏门的项目
- Flutter的ListView
- spring|spring boot项目启动websocket
- 我在管理实验班中的一些经验教训
- vuex|vuex 基础结构
- 区块链开发平台(以太坊)
- 如何在手机上查看测试vue-cli构建的项目