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 flutter.io/setup 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
- Make sure your device runs Android 4.1 (API level 16) or higher
flutter devicescommand in the terminal to make sure that Flutter recognizes your connected Android device.
- Try to disconnect your device (pull the plug) and connect it again
- Try switching Android Debugging off and on again
- 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)“
- 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“
- Try restarting your device
- Check if your cable is actually working. Some USB cables only have a power supply, but don’t support data transfer
- ADB server might be hanging. Try
adb start-serverin your command line
- Try to run
flutter run --verboseto get more information on what’s going on
- Windows-only: Install the Google USB Driver.
- Your flutter installation might not be aware of the Android SDK location. Run
flutter config --android-sdk ANDROID_SDK_PATHto configure it
- Use an Android emulator instead of a real device:
flutter emulatorswill list all available emulators.
flutter run -d "EMULATOR-ID"will launch an emulator
- There is even an alternative emulator called Genymotion, if you got issues with the default Android emulator
Connecting to your iOS simulator
- Check whether you installed the latest version of Xcode.
- After the update execute
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developerin the terminal
Not what you’ve been looking for? You can also start with the basics of Flutter testing and get started from there.