經(jīng)驗:Flutter項目IOS真機部署及問題

用flutter開發(fā)ios應用在真機調(diào)試時出現(xiàn)的問題以及處理方式

無法連接iphone手機

flutter找不到真機,已經(jīng)安裝Xcode,Xcode里面可以打開真機運行,但Android Studio環(huán)境和Vscode環(huán)境下,不能找到連接的iPhone真機,其實很簡單,終端運行一下:

flutter doctor

即可,控制臺提示如下:

image-20190104201612194

按照提示終端執(zhí)行 截圖綠色部分的命令即可。

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連上真機以后,點擊調(diào)試,會出現(xiàn)如下問題:

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.
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)

用xcode打開 flutter項目/ios/Runner.xcworkspace 這個文件,好,我們手動打開,點擊編譯,此時會編譯不通過~

出現(xiàn)這個問題的原因是你的xcode project 中的team沒有選擇,選擇方法如下。

img

不受信任的開發(fā)者

解決方式:打開手機上的"設(shè)置->通用->設(shè)備管理->開發(fā)者應用",進入以后,點擊"信任 xxxxx@xxx.com"


參考鏈接

官方鏈接:https://flutter.io/docs/get-started/install/macos
我的博客:https://meandni.com/2019/01/04/5671/

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容