Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.77k stars 10.47k forks source link

Window Pop up after typing scrcpy in cmd but gets closed automatically in 2 sec. #1600

Open 9374020304 opened 4 years ago

9374020304 commented 4 years ago

Environment

Describe the bug I just want to record my gameplay with scrcpy. I already have adb and scrcpy on my pc and also started USB Deugging on My Device. adb device command also shows my device. but when i type scrcpy command a window just pop up showing device name on it and it just get closed automatically. is there any solution for that i have been working on this thing for last 2 days. There is no error the window for mirroring pop up and get closed automatically in 2 sec. Uploading a screenshot with the command i used. Error

rom1v commented 4 years ago

I guess adb is getting disconnected. Open a separate console with adb logcat and keep it open. If it terminates at the same tile as scrcpy, then it's adb which disconnects.

In that case, try to use another USB cable or port (see #281 #283).

rom1v commented 4 years ago

Otherwise, there is probably an error printed in adb logcat, please post it.

9374020304 commented 4 years ago

i started another console with adb logcat and tried using scrcpy in another window first it shows some error i am attaching a file on that and in another try the cursor just keep blinking i need a solution asap please do something. error 1

9374020304 commented 4 years ago

Otherwise, there is probably an error printed in adb logcat, please post it.

Hoping a Reply ASAP!!!

9374020304 commented 4 years ago

Can i get a answer please i am working on it for last 3 days atleast in tomorrow morning it gets connected and i was mirroring for 10 mins but then again it gets connected and after 1 sec it just close the app i need a solution please that is my last hope for mirroring.

Otherwise, there is probably an error printed in adb logcat, please post it.

9374020304 commented 4 years ago

error i am getting this error after i use the command scrcpy -Vdebug Please Help!!

rom1v commented 4 years ago

Tl dump the logs:

adb logcat -c  # clean the logs
scrcpy
# once it is closed
adb logcat -d > logcat.txt

Then post your logcat.txt.

9374020304 commented 4 years ago

logcat.txt Here it is.

rom1v commented 4 years ago

I don't find any error specific to scrcpy. A lot of errors related to CamX...

i was mirroring for 10 mins but then again it gets connected and after 1 sec it just close the app

So it's probably a crash in your device system. If you reboot, does it work again?

Does adb shell screenrecord /sdcard/file.mp4 work? What about scrcpy -m800?

9374020304 commented 4 years ago

I don't find any error specific to scrcpy. A lot of errors related to CamX...

i was mirroring for 10 mins but then again it gets connected and after 1 sec it just close the app

So it's probably a crash in your device system. If you reboot, does it work again?

Does adb shell screenrecord /sdcard/file.mp4 work? What about scrcpy -m800?

I have already tried 3 or 4 devices i dont think there is any error in my device. even scrcpy -m 800 is not working

rom1v commented 4 years ago

I have already tried 3 or 4 devices

Did you try with another cable/USB port? (#281 #283)

9374020304 commented 4 years ago

yeah i tried it, the window just open and get closed in 1 sec

rom1v commented 4 years ago

If this happens to several (different) devices, the problem is on the computer-side. Could you try with another computer/OS?

9374020304 commented 4 years ago

yup i just tried using another pc and it works just fine. So that is clear the problem is with my pc. Is there any solution for that??

rom1v commented 4 years ago

It might be due to insufficient USB power. Or maybe bad USB drivers...

Try with another OS (run a live CD of some Linux distrib to test).

9374020304 commented 4 years ago

Should i try formatting my pc?

9374020304 commented 4 years ago

is it gonna help?

9374020304 commented 4 years ago

can i get your email or something so we can personally i really want to run scrcpy i can even format my whole laptop for this to work u can imagine how important it is for me to get it working. i have to invest in some capture card if i dont get any solution from you please help me with that. i know that the problem is in the laptop so should i format it?

rom1v commented 4 years ago

Download a live cd of Ubuntu for example, and run it. No need to format.

9374020304 commented 4 years ago

ok thank you i will try that and contact again.

9374020304 commented 4 years ago

but i have one more question if it will work with ubuntu how can i make it work on my windows? i want to run it on my windows and record it.

9374020304 commented 4 years ago

Can u answer?

9374020304 commented 4 years ago

Yup working just fine in the ubuntu latest version but there is some problem in win 10 i think. i tried playing around in ubuntu live cd but it lags so much and frame drops continuously so i think i have to invest in a capture card now. Thank You so much for all the help and support.

rom1v commented 4 years ago

(It lags probably because it's a livecd without all the firmware/drivers. It should work with a real install.)

9374020304 commented 4 years ago

but now how can i get it working on my windows?

rom1v commented 4 years ago

I don't know. My guess is that disconnections are due to a problem with your USB drivers or USB power. If it works from Ubuntu, then it's probably your drivers or some Windows problem.

(Could you confirm that adb logcat in a separate terminal terminates at the same time as scrcpy is unexpectedly disconnected?)

rom1v commented 4 years ago

Does it work better with v1.9 or v1.10 instead of v1.14?

rom1v commented 4 years ago

Did you try to reduce the definition? https://github.com/Genymobile/scrcpy/issues/283#issuecomment-672939254