isonic1 / flick

A CLI with helpful QA tools for Android (Devices & Emulators) and iOS (Devices).
MIT License
103 stars 26 forks source link

video for simulator #11

Open saikrishna321 opened 7 years ago

saikrishna321 commented 7 years ago

@isonic1 is it possible to take videos from simulator ?

isonic1 commented 7 years ago

@saikrishna321 right now it's just real devices. I haven't had a chance to look into it yet but when I have a moment I will. I know people in the past used quicktime to do it but that library is not maintained anymore.

saikrishna321 commented 7 years ago

@isonic1 why not use apple script to take screenshot

      def capture_script
        "osascript <<EOF
        tell application \"#{simulator_app_name}\"
        activate
        delay 0.5
        tell application \"System Events\" to keystroke \"1\" using {command down}
        delay 0.5
        tell application \"System Events\" to keystroke \"s\" using {command down}
        end tell
        EOF"
      end
isonic1 commented 7 years ago

@saikrishna321 sorry, was traveling and missed this. Does that apple script take a screenshot of a simulator? If so, I can add the logic to Flick. :)

saikrishna321 commented 7 years ago

@isonic1 yah it does .. Trust selconf went well đź‘Ť

isonic1 commented 7 years ago

@saikrishna321 Cool! When I have some time I'll add this. Thank you for the code!

ya, seconf went very well. The organizers did an amazing job. The next one has already been announced for Austin, Texas in April next year. Should be a good one too.

JulesMoorhouse commented 6 years ago

You can use the simulator directly xcrun simctl io booted recordVideo however this doesn't include sound.

I found this, which isn't the simulator https://apple.stackexchange.com/questions/63056/can-applescript-be-used-to-automate-a-screen-recording-session-on-os-x

There's also soundflower https://apple.stackexchange.com/questions/45689/can-i-get-system-sound-along-with-quicktime-player-screen-recording

isonic1 commented 6 years ago

thanks @Jules2010. This looks great! I should be able to implement both screenshots and video for ios simulator easily.

JulesMoorhouse commented 6 years ago

I’ve also had to automate QuickTime to record sound and use ffmpeg to merge and resize. I also rotate, as my app is landscape but haven’t got this acceptable with itc yet.