facebook / idb

idb is a flexible command line interface for automating iOS simulators and devices
https://fbidb.io
MIT License
4.55k stars 436 forks source link

idb video-stream not working #787

Open DavidAsulin1 opened 2 years ago

DavidAsulin1 commented 2 years ago

Description

idb video-stream --udid <UDID> not working. Expecting for streaming to start output to stdout, but nothing happened, also tried to pip the stream to ffmpeg like the doc suggested. When it starts, I got Running stream until ^C but when I ^C I get this output:

idb video-stream --fps 30 --format h264 --compression-quality 1.0 --udid 8748744C-0D38-4043-8877-4439855964F4 
Running stream until ^C
^C
Stopping stream
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/grpclib/client.py", line 368, in recv_initial_metadata
    headers = await self._stream.recv_headers()
  File "/usr/local/lib/python3.9/site-packages/grpclib/protocol.py", line 342, in recv_headers
    await self.headers_received.wait()
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/locks.py", line 226, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/idb", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/idb/cli/main.py", line 355, in main
    return loop.run_until_complete(gen_main(cmd_input))
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/idb/cli/main.py", line 334, in gen_main
    await drain_coroutines(pending)
  File "/usr/local/lib/python3.9/site-packages/idb/cli/main.py", line 342, in drain_coroutines
    await asyncio.wait_for(
  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/tasks.py", line 479, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/client.py", line 1064, in stream_video
    await stream.send_message(
  File "/usr/local/lib/python3.9/site-packages/grpclib/client.py", line 253, in send_message
    with self._wrapper:
  File "/usr/local/lib/python3.9/site-packages/grpclib/utils.py", line 51, in __enter__
    raise self._error
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/client.py", line 1060, in stream_video
    async for data in iterator:
  File "/usr/local/lib/python3.9/site-packages/idb/grpc/stream.py", line 51, in generate_bytes
    async for item in stream:
  File "/usr/local/lib/python3.9/site-packages/grpclib/stream.py", line 61, in __anext__
    message = await self.recv_message()
  File "/usr/local/lib/python3.9/site-packages/grpclib/client.py", line 425, in recv_message
    await self.recv_initial_metadata()
  File "/usr/local/lib/python3.9/site-packages/grpclib/client.py", line 397, in recv_initial_metadata
    self.initial_metadata = im
  File "/usr/local/lib/python3.9/site-packages/grpclib/utils.py", line 70, in __exit__
    raise self._error
grpclib.exceptions.StreamTerminatedError: Connection closed

Reproduction

idb video-stream --fps 30 --format h264 --compression-quality 1.0 --udid 8748744C-0D38-4043-8877-4439855964F4

Solution

?

Additional Information

tburakdemir commented 2 years ago

Same problem.

stoefln commented 2 years ago

Same here

tegorov commented 1 year ago

Same problem

Alex15190 commented 1 year ago

Make sure idb/your app has camera access enabled.

SPrasadT commented 1 year ago

@Alex15190 - Which app are you referring to?

muhanov commented 1 year ago

Similar issue We sure we added Camera permissions. Our app is requesting them. But idb works time to time, absolutely unstable.

Screenshot 2022-12-22 at 15 38 17
tburakdemir commented 1 year ago

@muhanov Hey, although we gave the camera permission to terminal, video-stream is still unstable. Did you find any solution?

muhanov commented 1 year ago

@muhanov Hey, although we gave the camera permission to terminal, video-stream is still unstable. Did you find any solution?

@tburakdemir No we didn't. Our decision is to write our own app for screen capturing.