Flutter研究(二)- 找不到设备

上文:iOS flutter研究(一)- 安装

flutter_app打开后,找不到设备(模拟器、真机)

一、配置环境变量

$ export PATH=$PATH:/Library/flutter/bin

二、运行run flutter doctor

$ flutter doctor

运行结果:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.13.6 17G65, locale
    zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[!] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with
      Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install with Brew:
        brew install ios-deploy
    ! CocoaPods out of date (1.5.0 is recommended).
        CocoaPods is used to retrieve the iOS platform side's plugin code that
        responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work
        on iOS.
        For more info, see https://flutter.io/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup
[✓] Android Studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Android Studio (version 3.2)
[!] IntelliJ IDEA Ultimate Edition (version 2017.1.6)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories

三、问题解决

从运行结果可以看出有[!]标识的都是有问题的选项。
1、更新command-line


图片.png

2、执行以下命令

 $ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

3、查看Android Studio工具,现在已经可以找到iPhone模拟器了,使用模拟器已经可以正常运行
4、安装homebrew
5、确保homebrew是最新版本

 $ brew update

6、执行以下命令

 $ brew install --HEAD usbmuxd

 $ brew link usbmuxd

 $ brew install --HEAD libimobiledevice

 $ brew install ideviceinstaller ios-deploy cocoapods

 $ pod setup

7、打开Android Studio设备切换为真机,运行成功

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Content: Flutter框架概况发展概述发展历史框架特性框架结构 快速入门安装Flutter在Mac OS...
    EchoZuo阅读 6,693评论 3 54
  • 1、通过CocoaPods安装项目名称项目信息 AFNetworking网络请求组件 FMDB本地数据库组件 SD...
    阳明AI阅读 16,275评论 3 119
  • 感恩家人健康,出入平安! 感恩有人租脚手架,让钱宝宝流向我的口袋。 感恩有人约杨林看船,让钱宝宝流向他的口袋。 感...
    荣漉阅读 185评论 0 0
  • 看文须知:1.小萌新还请多多关照,人物归作者,ooc我的错。2.冰哥x沈九(渣反)3.私设颇多请多包涵那么就开始吧...
    寒萧松石阅读 495评论 0 2
  • 尝试以图片形式发布读书笔记,欢迎交流。 一些值得反思的概念和观点: 利基产品不是为所有人准备的。 热门 大热门和流...
    Wantomato阅读 1,754评论 3 0

友情链接更多精彩内容