facebook / idb

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

Unable to record video using idb command #571

Open rohantan opened 4 years ago

rohantan commented 4 years ago

Description

I am trying to generate a video of the Simulator screen which is booted by idb

What I did: Executed command-

$idb record record-video --udid xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx --log INFO video.mp4

2019-10-29 15:51:17,136 [INFO] - video - idb state file stored at /tmp/idb_state
2019-10-29 15:51:17,137 [INFO] - video - idb local targets file stored at /tmp/idb_local_targets
Running video until ^C
2019-10-29 15:51:17,137 [INFO] - video - Starting connection to backend
2019-10-29 15:51:17,137 [INFO] - video - using companion CompanionInfo(udid='xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx', host='localhost', port=55880, is_local=True)
2019-10-29 15:51:17,138 [INFO] - video - Starting video recording to local file video.mp4
^C
Stopping video
2019-10-29 15:51:40,289 [INFO] - video - Stopping video recording
2019-10-29 15:51:40,290 [INFO] - video - Video saved at output path

What I expected: After I perform ^c on keyboard, it should generate a video.mp4 file in the current directory with the recording of simulator screen

What actually happened: I do not see any .mp4 file created in the current directory

Reproduction

Host OS - MAC OS version - macOS Mojave 10.14.6 python version - 3.7.4 XCode version - 11.1 idb client - Installed using pip3 install fb-idb on 28th October 2019 idb_companion installation details - (version 1.0.8)

$brew info idb-companion

facebook/fb/idb-companion: stable 1.0.9 (bottled), HEAD
A Powerful Command Line for automating iOS Simulators
https://github.com/facebook/idb/README.md
/usr/local/Cellar/idb-companion/HEAD-23adc4c (252 files, 25.4MB) *
  Built from source on 2019-10-28 at 17:01:24
From: https://github.com/facebook/homebrew-fb/blob/master/idb-companion.rb
==> Dependencies
Required: grpc --1.23.0_1 ✔
==> Requirements
Build: xcode ✔
==> Options
--HEAD
    Install HEAD version
$idb describe

TargetDescription(udid='xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx', name='iPhone 8', state='booted', target_type='simulator', os_version='iOS 13.1', architecture='x86_64', companion_info=CompanionInfo(udid='', host='', port=0, is_local=False), screen_dimensions=ScreenDimensions(width=750, height=1334, density=2.0, width_points=375, height_points=667))

Steps:

  1. idb boot --udid xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx
  2. idb connect xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx
  3. idb record record-video --udid xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx --log INFO video.mp4
  4. ^C on terminal
SagarBShinde commented 4 years ago

Facing the same issue Configuration: Host OS - MAC OS version - macOS Mojave 10.14.5 (18F132) python version - Python 3.7.0 XCode version - Version 10.2.1 (10E1001) idb client - Installed using pip3 install fb-idb on 4 Nov 2019 idb_companion installation details - (version 1.0.8)

rohantan commented 4 years ago

Not sure how but I am now able to generate video using this command - (I have not changed any installations on my mac as far as I remember) idb record video video.mp4 --udid xxxxxxxx-7848-47C5-B199-xxxxxxxxxxxx

ting81 commented 4 years ago

I also encountered the same issue, here is the command and output

idb record video video.mp4 --udid xxxxx Running video until ^C ç çççç^C Stopping video Failed to remove create auxillary directory for device at video.mp4

idb record video video.mp4 --udid xxx --log INFO 2020-07-03 09:44:53,773 [WARNING] - video - Setting --log after the command is deprecated, please place it at the start of the invocation Running video until ^C 2020-07-03 09:44:53,776 [INFO] - video - Starting connection to backend 2020-07-03 09:44:53,776 [INFO] - video - Starting video recording to local file video.mp4 ^C Stopping video 2020-07-03 09:45:06,341 [INFO] - video - Stopping video recording Cannot create a new video recording session, one is already active

tolgraven commented 4 years ago

Same issue as @rohantan when trying to record simulator, and same as @ting81 on an actual device (but maybe that's not supposed to work anyways?)

mklpanasiuk commented 1 year ago

Hi all, I was able to fix the issue with the screen recording only after using the full path to video file, like this: idb record video --udid xxxxxxxxxxxxxxxxxxxxxxxxxx /Users/your_user_name/Workspace/SandBox/myvideo.mp4