How do I run/test my Flutter app on a real device?
For Android, this is pretty easy:
- Enable Developer options and USB debugging on your device. This varies slightly by Android version, but the short version is you tap on the Device Build Number 7 times. Then a "Developer Options" option comes up and you can click "enable USB Debugging." See the linked Android documentation for the most up-to-date instructions.
- Then plug your phone into your computer with a USB cable. You'll probably see some popup on your phone asking if you want to allow USB debuggng with that computer. Say "yes".
- Run Flutter just like you would if you had a simulator running.
For iOS this is a little more complicated because you need an Apple ID or to sign up for a "Developer Account":
- Open XCode, then open "Preferences>Accounts". Sign in with your ID.
- "Manage Certificates" > click on the "+" sign and select "iOS Development".
- Plug your device into your machine. Find your device in the drop down (Window > Organizer).
- Below the Team pop-up menu, click Fix Issue.
- In Xcode, click the Run button.
(in subsequent runs, you can deploy to the iOS device with Android Studio, VS Code, or any other IDE of choice, you just need to set up that certificate the first time with Xcode. Here's Apple's documentation on setting up Xcode to run a physical device.)
Flutter app - Unable to test on real device! Something wrong with the X-Code version
Xcode 13.2.1 will not support iOS version above 15.2 that's the reason for this issue update the Xcode to latest version to use iOS 15.5
How to `flutter run` with target device as android?
flutter -v -d your_android_device run
selects the target device to run on.
Flutter connect real 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.
- Install the Google USB Driver
- 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.
You get full instructions and more information here: Flutter Docs
Is it possible to test my apps made with flutter using my android device?
Yes it is, Just go to settings search for developer options and then enable it, if you don't get that then go to your phone info/details and scrol to the bottom and just tap on the build number 7 times and a toast will show that dev mode is enabled. Then just connect your device and run your project!
If you don't get any of these then connect your usb first and then click on the notification which says usb connected then change the option from charging to enable debug mode. Make sure you allow your computer when a dialog box appears after that.
Related Topics
Phonegap Cdvviewcontroller.H File Not Found When Archiving for iOS
Core Animation Progress Callback
Force Landscape Orientation in Uiimagepickercontroller
Getting the Word Touched in a Uilabel/Uitextview
How to Implement the Hashable Protocol in Swift for an Int Array (A Custom String Struct)
Why Are Didbegincontact Called Multiple Times
Passing Image to Another View Controller (Swift)
What's the Difference Between All the Selection Segues
Automatic Preferred Max Layout Width Is Not Available on iOS Versions Prior to 8.0
Error When Adding Input View to Textfield iOS 8
Is Nstimer Expected to Fire When App Is Backgrounded
iOS 9 Facebook Login Simulator -Canopenurl: Failed for Url: "Fbauth2:///" - Error: "(Null)"
Swift Editor Placeholder in Source File
Where's the Difference Between Setobject:Forkey: and Setvalue:Forkey: in Nsmutabledictionary
Volunteermatch API Objective C
Getting User Location Every N Minutes After App Goes to Background