Debug Flutter app on Android device while simultaneously showing its screen on desktop with scrcpy - flutter

Working in Ubuntu, I'm debugging a Flutter app on my Android phone while I code it. So far that works fine, but I would like to see the phone screen on my pc for comfort. I know an emulator would do the trick, but for performance issues I used my phone instead.
So far I installed scrcpy, and managed to show the phone screen on the pc via WiFi debugging. The problem comes when I try to run both connections at the same time. If I have the WiFi scrcpy connection on, it disconects right when VS Code connects with the device via USB. And viceversa, if the USB debugging is on, attempting to start scrcpy kills the Flutter debug.

Related

Is there a way to run flutter from vs code to a real device like iphone 11 pro? Working on windows

So i'm new at flutter and i want to run my app to my real device. Working on windows 10 with vs code. I want to do this because when i run my app with android emulators my pc starts going slow.
Thanks!
You can follow this tutorial if you want to run your application on an actual device with USB connection: https://www.youtube.com/watch?v=aohkII1C4JY&ab_channel=JohannesMilke
And also there is another way to run your app on an actual device which you can do it wirelessly: https://www.youtube.com/watch?v=BymD9pxtVwY&t=161s&ab_channel=AppMakingAcademy

flutter doctor: device is offline

After running Flutter doctor to see why my physical LG G6 device was not being picked up, I found out that the "Device is offline".
I've tried googling around, and unplugging and re plugging the device.
Nothing seems to work.
What does this mean? My device does have debug enable, and it's definitely connecting to the pc and flutter definitely see it.
It could be a problem with the USB cable.
Had the same problem, then tried another cable, plugged in the same port as the old cable, and it didn't go offline.
If I plug in the old cable, the same problem happens: it goes offline after some time, even though it's connected, and I can see my device's files in Windows.

Android Emulator starts, but it doesn't run android system

I try to run my app in android emulator. From the begining, everythigs works fine. I create new device in Android Vrtual Device Manager, then i run the device. After a while i can see an emulator with mobile skin - that's all, nothing else happens. The device has black screen and in the Android Monitor I see this:
screen from Android Monitor
When i try to run my app I recive this:
screen from selecting deployment
When I try to run app from this window, somethig is going to happen. I have to wait long long time but finally, android is started on the device but meanwhile i recive error "Session 'app':Error Instaling APK. Sometimes app will run, sometimes not, but everything works very very slow. When i run app directly (without running device from AVD Manager), app is bulided and then i see a process "Waiting fro target device to come online", emulator runs but with black screen.
I have no idea what to do now. I reinstaled Android Studio twice - always the same result.
I have to add that a few days ago everythings works perfect - very fast and without problems. Recently I was installing Ubuntu on a new partition, I've done some changes in widows driver manager. Maybe this is a reason?
What I should do now? Thanks in advance

How to sync Android device with eclipse

I have a Android device. How to sync with Eclipse for execute code directly in mobile not in emulator.
Just simply connect your phone via USB cable to your computer and run your application. Window pops up and you can choose then between connected devices. Make sure you enabled debugging mode in your device.

How do I use Xperia Ray through Eclipse for Android programming?

I downloaded the Suite for the phone, the Google USB drivers and the Phone's connection drivers. So far, the phone works perfectly with the PC but Eclipse still refuses to see the phone and Device Manager is convincing me that I have no hardware compatible with the Google USB drivers. Therefore the Google USB drivers are downloaded but not installed or assigned to any device. I followed every answer on stackoverflow that there is so far, but none have solved the problem.
First, set your device into USB / debug mode.
Second, after you connect your device to the USB make sure your drivers is installed properly.
And last verify that adb.exe can detect you device from cmd (if running in windows) ..(path to your SDK)\platform-tools\adb device
If last step fails, then re-install you device driver, it should be handled automatically by sony pc-companion for your xperia phone.
You also have to enable USB-Debugging in Settings->Developer Options on your phone.