Skip to content
forked from isonic1/flick

A CLI to capture screenshots, video, logs, and device information for Android (Devices & Emulators) and iOS (Devices).

License

Notifications You must be signed in to change notification settings

skywind0218/flick

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLICK

A CLI to capture screenshots, video, logs, and device information for Android (Devices & Emulators) and iOS (Devices).

Features

  • Easily capture screenshots for Android and iOS.
  • Video record real android devices. (OS > 4.4)
    • Extend recording past the 180 seconds SDK limit.
  • Save video formats in mp4 or gif.
  • Flick auto detects if a device is recordable.
    • Falls back to screenshot recording if video record is not available.
  • Video record android emulators and real iOS devices.
    • Takes a screenshot every 0.5 seconds (default), then combines the screenshots into a single mp4 or gif.
    • Android pulls only unique (default) screenshots from devices/emulators. e.g. A 1 minute test run might convert to only 30 seconds of video based on unique images. You can change this by passing -q false to pull all images instead.
    • iOS example here
    • Android Emulator example here
  • Flick auto selects device when only one device is connected, per platform.
  • Save log output for Android or iOS.
  • Display device information or save it to a file.

Reason

I wanted an easy way to video record my automation tests for mobile, and I didn't need the video quality to be perfect. Unfortunately, you cannot video record on android emulators, but you can take screenshots! You also cannot video record iOS without using QuickTime, or doing what this did, but it's not maintained anymore.

So I created Flick to work for my needs, and included a couple other tools I use frequently. Hopefully this will be as helpful for others too. It's also a CLI and language-agnostic, it can be used with any framework where you can make a system call. See examples here and here. I suppose there are use cases for this outside of test automation. I'd love to hear them if so.

If you're looking for high-quality video, then this wouldn't be the tool for you. Take a look at this great tool androidtool-mac instead.

Prerequisites

System Tools

  • Install ffmpeg. OSX
    • $ brew install ffmpeg
  • Install mp4box. OSX
    • $ brew install mp4box

Android

iOS

Installation

$ gem install flick

Usage:

$ flick --help

DESCRIPTION:

A CLI to capture screenshots, video, logs, and device info for Android (Devices & Emulators) and iOS (Devices).

COMMANDS:

help       Display global or [command] help documentation           
info       Get device information           
log        Get device log output            
screenshot Take a screenshot                
video      Record video     

GLOBAL OPTIONS:
    
-h, --help 
  Display help documentation
    
-v, --version 
  Display version information
    
-t, --trace 
  Display backtrace when an error occurs
  • See usage examples in:

    $ flick info --help

      $ flick info -p (ios or android)
      $ flick info -p (ios or android) -s true -o $HOME
    

    $ flick log --help

      $ flick log -a start -p (ios or android) -o $HOME -n iosLog
      $ flick log -a stop -p (ios or android)
    

    $ flick screenshot --help

      $ flick screenshot -p (ios or android)
    

    $ flick video --help

      $ flick video -a start -p (ios or android)
      $ flick video -a stop -p (ios or android) -o /output -n myVideo -f gif
      $ flick video -a start -p android -u emulator-5554 -c 1000
      $ flick video -a stop -p android -u emulator-5554
    

Demo

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/isonic1/flick. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

TODO

  • Dry the code a bit.
  • Setup Flick android for cross platform os's (windows & linux)
  • Add screenshot capture for iOS Simulators.
  • Multithread the screenshot and pull process.
  • Look into capturing video for iOS similar to this

License

The gem is available as open source under the terms of the MIT License.

About

A CLI to capture screenshots, video, logs, and device information for Android (Devices & Emulators) and iOS (Devices).

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.6%
  • Shell 0.4%