我已经通过 USB 将 Android Phone 连接到我的 mac 上。而且 flutter devices 没有列出我的手机。
我已经在我的手机中启用了开发者选项,并通过 MTP 连接设置了 USB。
必须安装 Android Studio 吗?
这是'flutter doctor'的输出
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale
en-US)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/setup/#android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, set
ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.35.1)
[!] Connected device
! No devices available
! Doctor found issues in 3 categories.```
最佳答案
必须安装 Android SDK(Android Studio 的一部分)。 Flutter 依赖于 Android SDK 来开发 Android 应用程序,但您不需要使用 Android Studio 作为 Flutter 的 IDE。
或者你可以只安装android-sdk如果您不想要完整的 Android Studio 安装。
关于flutter - 如何修复 flutter doctor 无法识别 Android 手机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56880763/