I want to run/test (not automated test) my Flutter app on a real iPhone and Android phone during development. However, Flutter docs seem to only document how to do it with the iOS simulator or Android emulators.
I think it's already a no-brainer for iOS/Android devs but I am neither and Flutter is my first foray into mobile development.
Is there any link to a beginner's guide somewhere on how to develop while running it on a real device (with all of Flutter's live-reload goodness)?
Additional context
Set up and deploy Flutter apps on your Android device 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.
If you have multiple devices or simulators connected then there are a number of ways to quickly switch between them: Clicking on the currently selected device in the status bar. Executing the Flutter: Select Device command. Pressing your custom key binding for the Flutter: Select Device command.
To test or deploy our flutter app to a physical device we first need to enable physical device deployment in Xcode using Apple ID or an Apple Developer account. And we also need to set up a package manager to manage flutter plugins that are to be used in the project.
For Android, this is pretty easy:
For iOS this is a little more complicated because you need an Apple ID or to sign up for a "Developer Account":
(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.)
Also, you can use your android device wirelessly using scrcpy.
Visit this link and install scrcpy. https://github.com/Genymobile/scrcpy
After you install and path scrcpy on your PC/Laptop.
Make sure your phone is connected to your PC/Laptop.
Enable Developers Options and Connect your device to the WIFI.
Open CMD.
Input "adb tcpip 5555". The adb should be restarted
Next, input "adb connect ipaddressofyourdevice:5555" Ex: adb connect 192.168.254.19:5555
Now, you can use your device wirelessly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With