Message "flutter run: No connected devices"
Solution 1
Flutter supports both iOS and Android device/simulators.
In the terminal, run the
flutter devices
command to verify that Flutter recognizes your connected Android device.
Here is a reference document on how you can set up a device/simulator to run your application.
For, Android (on a Mac system)
Set up your Android device
To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.
- Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
- Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
- In the terminal, run the
flutter devices
command to verify that Flutter recognizes your connected Android device. - Start your app by running
flutter run
.
By default, Flutter uses the version of the Android SDK where your ADB tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_HOME
environment variable to that installation directory.
Set up the Android emulator
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
- Enable VM acceleration on your machine.
- Launch Android Studio → menu Tools → AVD Manager and select Create Virtual Device.
- Choose a device definition and select Next.
- Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
- Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware acceleration.
- Verify the AVD configuration is correct, and select Finish.
For details on the above steps, see Managing AVDs.
- In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
- Start your app by running
flutter run
. The connected device name is Android SDK built for <platform>, where platform is the chip family, such as x86.
- Here is another document, if you're using (Microsoft) Windows System: Get Started: Install on Windows
Open & Connect Device using Android Studio:
Here is an easier way to open and connect simulators/devices.
Android Studio shows a list of emulators/simulators (installed in your system) or devices (connected to your system). Just select a device you want to open from a list, and run the project.
Solution 2
Use:
flutter config --android-sdk ANDROID_SDK_PATH
Or
- Device Not Found (when setting up Flutter in Android Studio)
- Project structure -> select latest Android API in Project SDK
Solution 3
This was my solution:
My "Developer Options" was ON, but the "USB Debugging" was OFF.
So I turned ON the USB Debugging and the problem was solved.
Solution 4
None of the suggestions worked until I ran:
flutter config --android-sdk ANDROID_SDK_PATH
Use "PATH" = your path. For example:
flutter config --android-sdk C:\Users\%youruser%\AppData\Local\Android\Sdk
Solution 5
I solved the AVD problem with Flutter using the Flutter console.
Step 1:
C: \ Users \ valer> flutter emulators
6 available emulators:
3.2_QVGA_ADP2_API_22 _-_ Lollipop • 3.2in QVGA (ADP2) • Generic • 3.2 QVGA (ADP2) API 22 - Lollipop
Android_ARMv7a
Android_Accelerated_x86
Nexus S API Google Nexus S API 23
Nexus_S_API_25_1080x1920_Nougart_7.1.1_ • pixel • Google • Nexus S API 25 1080x1920 (Nougart 7.1.1)
Pixel_API_28 • pixel • Google • Pixel API 28
To run an emulator, run flutter emulators --launch <emulator id>
.
Step 2:
C: \ Users \ valer> flutter emulators --launch Pixel_API_28
PULL STACK DEV
Full-time freelance Full-stack Developer. Hire me at [email protected]
Updated on July 08, 2022Comments
-
PULL STACK DEV almost 2 years
I am trying to create a sample application with Flutter (fresh installation). Android Studio is also installed (fresh installation).
Here is the output of
flutter run
flutter run No connected devices.
The output of
flutter doctor
: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 ! Doctor found issues in 2 categories.
Is there a solution to this problem?
-
Dan almost 6 yearsThanks. I reinstalled Genymotion and had to do this.
-
abjbhat over 5 yearsI can't get this to work. The emulator runs just fine. I can deploy and run an Android application to it. But the flutter project from Android studio keeps complaining that there's no emulator.
-
Roberto Góes over 5 yearsGenymotion isis lighter.
-
olisteadman about 5 yearsSame here, I get "No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions." Meanwhile I can see the emulator sitting there on the same screen, up & running.
-
pipedreambomb about 5 yearsI've had the same issue, where VS Code can run Flutter but terminal can't. I wonder if there's an argument I'm missing that would make it work? It doesn't seem to make sense; I think VS Code or XCode commands would just serve as front ends for the CLI.
-
sanjana almost 5 yearsin my case i havent launched emulator .once launching emulator u can run the app
-
nurulhudamustaqim almost 5 years{SOLVED} After a while I did an trial n error, I know exactly this problem is caused by corrupted adb file (by default "flutter devices" will call the "adb" file provided by the SDK, for example my adb.exe file exists in "C:\Android\Sdk\platform-tools "). the way to overcome this problem is to replace the file with the other adb file (make sure you have done a previous backup), you can replace your original adb with my adb file that you can download at the following link: gofile.io/?c=c0M3DC. Thanks
-
Shirish Kadam almost 5 yearsBy setting both the Project SDK and Module SDK fixed it. Thanks.
-
Mahdi-Malv almost 5 yearsThis solved my issue. I had running devices, but flutter was not able to detect them.
-
John Franke over 4 yearsshould be
open -a Simulator && flutter run
-
Richard over 4 yearswhat about ios on mac? I have several macs and my 2012 MBA (USB-A) will only make the connection available if itunes is running. Connecting the same device to my 2019 MBA (USB-C) flutter does not recognize the device even though iTunes does,
-
Richard over 4 yearsMy 2012 Macbook Air with USB-A can detect my iPhone5 but ONLY if I start iTunes. My 2019 Macbook Air with USB-C cannot detect the same iPhone5 (yes, trusted, and yes works in XCode and iTunes). My android phone works on both systems (no iTunes), however, on the 2019 MBA I need a USB-A/C dongle.
-
Pulller over 4 yearsMy iPhone can't recognize by flutter on the mac system. tried many ways, yours works well.Thanks~
-
pedro_bb7 over 4 yearsAfter doing that got
unable to locate Android SDK
-
1cedsoda over 4 yearsWorked for me. No SDK was selected
-
NearHuscarl over 4 yearsOn Windows 10 I had to restart my computer before it works
-
essbee over 4 years@eggrobot78 was able to address this by adding the Android SDK installation location as an environment path variable for ANDROID_HOME.
-
Wilmer over 4 yearsif there is no option project structure, restart android studio
-
Damyan Todorov about 4 yearsSolution for me about iOS: I had 2 Xcodes and by default, the android studio was pointing to 11.4 but it was opening the simulator from 11.3 (with lower version), I just opened a new simulator with version 11.4 and Android studio detected it.
-
NullByte08 almost 4 yearsSo you have to open the emulator first and then start build process of the project. Why cant they work simultaneously in flutter like normal android project?
-
Moberg over 3 yearsDo I need the Android SDK to run flutter on a connected device?
-
Fellow7000 over 3 yearsThanks a lot! Looks like this happens if you just clone the project from version control, so the environment is not setup automatically.
-
Peter Mortensen about 3 yearsAll: What is the explanation?
-
Peter Mortensen about 3 years
..AndroidStudioSDK\sdk
does not appear to be correct. Should it be..\AndroidStudioSDK\sdk
? Please respond (as approproate) by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today). -
Peter Mortensen about 3 years"Nougart"? Shouldn't it be Nougat? Was this the actual output (it already seems to have been manipulated)?
-
Peter Mortensen about 3 yearsWhat do you mean by "invalidating
catch
"? Can you elaborate? -
Peter Mortensen about 3 yearsWhat do you mean by "I put flutter there before"?
-
Peter Mortensen about 3 yearsIs the purpose of listing the emulators to get an emulator ID? Or something else? Can you make it more clear in your answer? Can you provide an example of an emulator ID? What does "it" refer to in "to build it"? What is built? Please respond by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).
-
Peter Mortensen about 3 yearsWhat do you mean by "changing "ANDROID_HOME" to the Environment variables"? Can you elaborate? Please respond by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).
-
Peter Mortensen about 3 yearsBy "PATH", do you mean "ANDROID_SDK_PATH"? Or something else? Can you elaborate? Please respond by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).
-
Peter Mortensen about 3 yearsIs "Simulator" literal?
-
Peter Mortensen about 3 yearsPresumably for Windows?
-
Jude Okoroafor about 3 yearsBy "Invalidate Catches" you'll be removing the virtual file system cache together with the information stored in Local History. This action might be helpful for troubleshooting purposes as the IDE caches information about your project’s structure.
-
crazyProgrammer about 3 yearsIn some cases the operative system installs automatically the ADB drivers
-
Vivek Gupta almost 3 yearsopen -a Simulator The above command will open iOS Simulator from mac Terminal
-
Shafkhan almost 3 yearsThis won't solve the problem above. This will open a simulator on a Mac machine.