Real devices is much different than emulator or simulators because there are so much features they cannot predict. When a developer debug or test their flutter application in Simulator then the result will be different than real devices because of App speed and Loading time. Simulators works on Computer processor and usages system RAM to speed but so they are slow in speed and not so much reliable. Real devices has their own processor with own memory management so they are much faster than Emulators. So this tutorial is for beginners and also for Pro developers who want to Run Test Flutter Apps Directly on Real Android Device in Windows MAC PC. So let’s get started 🙂 .
Features that Real device supports but Simulator dose not:
- Real devices has all the sensors like Light sensor, Gravity sensor, Compass sensor, Motion sensor, Fingerprint sensor, Accelerometer etc.
- Supports real time sms sending, calling feature.
Contents in this project Run Test Flutter Apps Directly on Real Android Device in Windows MAC PC Tutorial:
1. Before getting started we have to make sure that our mobile PC Suite software should be installed on our Computer. I am using my Redmi Note 5 Pro mobile phone for testing flutter application so i am installing MI’s official PC suite in my windows pc. Here is the MI PC Suite Download Link.
2. Enable USB Debugging Mode in Your Android Device:
1. Debugging mode must be enabled to install the flutter android app in real mobile device. So open Setting in your mobile device.
3. If you are using Redmi device than select MIUI Version and if you are using other brands android devices than select Build Number. Tap multiple times on MIUI Version or Build Number to enable developer options.
4. After tapping multiple times the developer options will be enabled.
5. Now go back to Additional Settings under System & Devices.
6. Click on Developer Options.
7. Enable the Developer Options.
8. Now Enable USB Debugging under DEBUGGING section.
9. It will ask you to Allow USB Debugging press on OK button.
10. Enable both USB Debugging and Install via USB options.
11. Now debugging mode is successfully enabled. Next step is to connect your mobile device VIA USB data cable to your computer. After connecting the device it you have to enable File Transfer.
12. Device will ask you again to Allow USB Debugging ? You have to enable Always allow from this computer and hit the OK button.
13. Here you go guys now your device is successfully connected to your computer and ready for testing – debugging apps in real device. To make sure your device is successfully connected you have to open Your_Android_SDK_Manager -> platform-tools folder in Command Prompt or Terminal. Execute
adb devices command in the folder like i did in below screenshot. You can see you connected device under List of devices attached menu.
14. Now GoTo Your_Flutter_Project_Folder and execute
Flutter run command to run flutter project.
15. As soon as you execute the flutter run command. Now flutter ask you to Install via USB , Enable the Remember my choice and hit the Install button.
15. Here you go guys now the flutter app will run in your real device.
Select Command Prompt window or Terminal and press H (Capital H) for Hot Restart and h (small h) for Hot reload 🙂 .