How to solve “No connected devices” when running Flutter apps

device connection issues flutter.

2 June 2022 Stephan Petzl Leave a comment Tech-Help

We noticed that a lot of times issues with connecting to test devices such as “No connected devices found; please connect a device, or see for getting started instructions.” pop up.

A good first start to find the origin of the issue is to run  flutter doctor in your terminal. The output might look like this in such a case:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[!] VS Code (version 1.20.1)
[!] Connected devices
[!] No devices available

We have compiled a list of things you can try if Flutter complains about “No connected devices” or “No devices attached”. The solutions are depending on whether you try to connect to Android or iOS:

Connecting to your Android device

Flutter for Android uses ADB (Android Debug Bridge) to communicate with your device. To use ADB with your device you must enable USB debugging in the device system settings, under Developer options.

On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find the Developer options at the bottom. On some devices, the Developer options screen might be located or named differently.

Important: When connecting, your device will show a dialog asking whether to accept an RSA key that allows debugging through your computer. Please accept, otherwise, Flutter will not be able to send data to your device.

Other things you can try to fix the broken device (or emulator) connection

  1. Make sure your device runs Android 4.1 (API level 16) or higher
  2. Run flutter devices command in the terminal to make sure that Flutter recognizes your connected Android device.
  3. Try to disconnect your device (pull the plug) and connect it again
  4. Try switching Android Debugging off and on again
  5. On Xiaomi and some other devices there is an extra toggle that needs to be activated in developer options: It’s located a couple of items below USB Debugging and it’s called “USB Debugging (Security settings)
  6. On Xiaomi and some other devices there is an extra toggle that needs to be activated in developer options: It’s located a couple of items below USB Debugging and it’s called “Install via USB
  7. Try restarting your device
  8. Check if your cable is actually working. Some USB cables only have a power supply, but don’t support data transfer
  9. ADB server might be hanging. Try adb kill-server and adb start-server in your command line
  10. Try to run flutter run --verbose to get more information on what’s going on
  11. Windows-only: Install the Google USB Driver.
  12. Your flutter installation might not be aware of the Android SDK location. Run flutter config --android-sdk ANDROID_SDK_PATH to configure it
  13. Use an Android emulator instead of a real device: flutter emulators will list all available emulators. flutter run -d "EMULATOR-ID" will launch an emulator
  14. There is even an alternative emulator called Genymotion, if you got issues with the default Android emulator

Connecting to your iOS simulator

  1. Check whether you installed the latest version of Xcode.
  2. After the update execute sudo xcode-select --switch /Applications/ in the terminal

Further reading

Not what you’ve been looking for? You can also start with the basics of Flutter testing and get started from there.

Like this article? there’s more where that came from!