Category: Blog, Android, QA

Hyperion – the “Swiss Army Knife” within your App

What is Hyperion? Why is it worth to use it? What are the core and third-party plugins examples? How to display device info inside your debug menu? Find the answers in this article.

Hyperion - App Debugging & Inspection Tool for Android

TL;DR: Hyperion is a simple debug menu with a lot of features, that helps development teams to verify changes in Android applications.

What is Hyperion?

Hyperion is a debug menu for an application in development, it’s a container for multiple plugins. One of the greatest features of this tool is adding new plugins or removing ones you don’t need.

Some of Hyperion plugins are developed by the Hyperion team, but there are also some third-party plugins like Hyperion-Chuck for inspecting OkHttp traffic or Simple-Item for creating custom tabs in Hyperion menu.

So, we can divide plugins into two categories:

  • Core plugins
  • Third-party plugins

Why Hyperion?

The answer is simple – it’s a modular tool with a lot of useful plugins. You have a wide range of various plugins to use and thanks to this modularity, you can choose and grab the one you need for your app and don’t mind ones you don’t need.

Core plugins examples

Core plugins are developed by the Hyperion team. They can be easily integrated with your existing code.

Here are a few examples of core plugins:

  • Hyperion-Geiger-Counter. This plugin is the only thing you need to feel like a true Slav while testing your app.
    Just imagine this feeling of returning to the Chernobyl while playing the Stalker. You can pair this plugin with some 3-stripes Adidas outfit and a jar of mayonnaise. Every member of your family will be happy, especially your babushka.
    Let’s return to the reality: this plugin works like a real Geiger counter but instead of detecting the radiation, it detects frame drops. You can use it for performance testing.
    Just remember to listen to some cheeki-breeki after successful testing. Stay cheeki breeki!
Cheeki Breeki

Credits to: www.meme-arsenal.com

  • Hyperion-Shared-Preferences. Thanks to this plugin you can edit your app’s shared preferences and do some crazy stuff like corrupting your refresh token and testing the app’s state in various extreme cases.
  • Hyperion-Attributes-Inspector. Plugin for inspecting properties of UI elements on the screen. Some properties are editable from the attribute inspector level. You can change textView and see how long strings inside your app’s layout can be.
  • Hyperion-Measurement-Inspector. As the name suggests, it is a plugin for pixel perfect testing of your app. You can measure the distance between UI elements and compare it to the design from your lovely designer (very useful).
  • Hyperion-Crash-Plugin. Thanks to this plugin, you can see crash log right away and have some bite of information about this crash. It is nice to have some piece of it and investigate it before reporting.
    Still, you can use Crashlytics, etc. but it is nice to have this plugin and see crash log right away when it occurs 🙂
  • Hyperion-Phoenix-Plugin – with this you don’t need to clear app data from the device settings. This plugin will help you to save time because it enables you can clean the app’s internal storage data and restart the process from your debug menu.

Third-party plugins examples

Third-party plugins add new functionalities for debug menu or add integration of existing QA tools with Hyperion.

Here are a few examples of third-party plugins:

  • Hyperion-Chuck by my opinion the most useful plugin for Hyperion. It integrates existing Chuck library for inspecting OkHttp traffic which I use a lot.
    The simplest use-case for it: when you have some issues within the app and you don’t know exactly what happened and you want to investigate it (e.g. login fails).

    With this plugin, the first thing you do is to check OkHttp traffic to tell if this bug is in the app or maybe those are server issues.
    I highly recommend this plugin because it’s extremely handy and easy to use.

  • Hyperion-Simple-Item my second favorite plugin. It allows you to add a custom tab in the Hyperion menu.

    In my implementation, I use it to create a field with device info such as device name and OS version. Having this information is very handy when reporting bugs because it’s super important to give some info about the device in your report.

Hyperion implementation

Let’s plug this nice piece of code into the app.

1. Gradle configuration

Generally, Gradle configuration is very simple. All you need to do is to follow guidelines from the Hyperion repositories. Here are a few helpful links:

2. BuildVariants configuration

You would like to have Hyperion configured to target the exact buildType or flavor because you probably don’t want users to see it.

In this case, the configuration is also simple because the libraries listed above use no-op implementation. So you can have:

  • Debug – Hyperion dependencies
  • Release – plugins no-op implementations

Thanks to the new Gradle you can simply use debugImplementation or releaseImplementation for dependencies. What’s more, you can also have, let’s say, developImplementation for your flavor.

Things get a little complicated when you want to implement some custom features such as device info in your Hyperion menu.

To use that you need to implement SimpleItem library in your code, but SimpleItem does not have no-op library for your release build variants.

To achieve this, you need to create two packages alongside your main package with app implementation.

Here is an example:

  • develop/kotlin/com/cheekibreeki/HyperionDeviceInfoInitializer.kt – Here you put the actual code for you simple item implementation let’s say
  • prod/kotlin/com/cheekibreeki/HyperionDeviceInfoInitializer.kt – Here you put just empty method for release purposes, thanks to that you have your own no-op implementation:

The last thing you need is to use this method in onCreate function inside your cheekibreeki application main file.

Bonus – how to display device info inside your debug menu

In order to display nice device info inside your debug menu you need this library and this code inside your initHyperionDeviceInfo method:

This will allow you to display device info inside Hyperion menu. The AndroidDeviceNames library that is used here, will help you to display more common names of devices (e.g. Samsung Galaxy S9 instead of SM-G960F). But there are still some phones with codenames.

Hope you like it and you will implement Hyperion and start testing your app like a true Slav 😉

Just remember to squat properly with your full feet on the surface while you’re testing. Send us photos of your squat testing and stay cheeki breeki!