• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A CLI with helpful QA tools for Android (Devices & Emulators) and iOS (Devices).

FLICK

A CLI to capture screenshots, video, logs, device info and device vitals(memory, cpu) 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.
  • Install or Uninstall applications from devices.
  • Capture device vitals (Android Only) for app and system performance.
    • If anyone knows of a tool to capture performance for iOS please let me know and I'll add it to Flick.
  • Checkout the latest release notes here.

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

Known Issues

  • IOS:

    • Sometimes ideviceinstaller gets out of sync with your OS due to various reasons. When this happens, screenshots and video will not work for iOS.
      • Follow steps in here to uninstall and reinstall dependencies.
      • Make sure xcode and command line tools are up to date.
      • Make sure iOS device is up to date with latest iOS version.
      • Validate your device is paired to your machine. $ idevicepair -u <udid> validate
      • Additionally, try to unpair and pair again.
        • $ idevicepair -u <udid> unpair
        • $ idevicepair -u <udid> pair Accept the Trust popup on the device.
  • Android:

    • Some devices/emulators are read-only. Flick requires access to internal storage of the device/emulator to write files to. If the device is read-only it cannot do this so it will Abort. There is probably a solution to this but I, unfortunately, don't have a lot of time to figure it out. Pull Requests are highly encouragaged if you find this tool useful!

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            
manager    Manage apps on devices           
screenshot Take a screenshot                
video      Record video             
vitals     Android Only! Get apps and device vitals - App Memory Used, App CPU %. System Stats: (User, System, IQW, IRQ)
applitools Validate images with Applitools 

GLOBAL OPTIONS:

-h, --help
  Display help documentation

-v, --version
  Display version information

-t, --trace
  Display backtrace when an error occurs

 $ 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) -o $HOME -n myImage

 $ 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

 $ flick manager --help
	$ flick manager -a install -p (ios or android) -f ~/myApp/my-awesome-app.apk or .app
	$ flick maanger -a uninstall -p (ios or android) -n com.package.name

 $ flick vitals --help
	$ flick vitals -p android -n com.awsome-package.name

$ flick applitools --help
  $ flick applitools -p android --appName Twitter --testName Messages 

##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.