我开始学习flutter工具包,需要在物理手机上运行该应用程序,不需要安装模拟器或Android studio,只需安装: A)Flutter sdk 并添加到 windows 路径。 B)安装vs code作为编辑器,只需添加flutter插件即可
C) 连接我的 Android 实体手机并已在开发者模式下工作。
运行命令时出现的问题
告诉我,我的手机未连接,当在 vs code 中使用 F5 运行应用程序时,要求模拟器,我不需要,我只需要物理手机。
那是flutter doctor,我有任何 body 可以帮助我将需要添加到我的电脑中的东西,不需要Android studio,不需要添加任何模拟器。
$ flutter doctor
[√Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft
Windows [Version 10.0.17763.1158], locale ar-SA)
[XAndroid toolchain - develop for Android devices
X 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.
[!Android Studio (not installed)
[√ VS Code (version 1.44.2)
[!Connected device
No devices available
医生发现了 3 类问题。
最佳答案
您必须需要 android sdk 才能在 Android 上运行 flutter 应用程序,并需要 xcode 才能在 iPhone 上运行。下载android sdk并再次检查。
关于windows - 在 Windows 上无需 Android Studio 或模拟器即可从 VS Code 运行 Flutter 到物理手机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61364244/