Mason Docs

Understanding X-Ray

X-Ray is a powerful capabilty provided by Mason that gives you a view into your production devices for debugging.

X-Ray and ADB

X-Ray is built on top of adb, the Android Debug Bridge. This suite of tools provides powerful access to any provisioned Mason device, giving you remote access to the device and the power of the tooling adb provides.

One of the most commonly used tools in adb is called logcat, which provides a steam of global logs across the entire system.

Looking for a walkthrough on adb? Visit our guide for using ADB on a Mason devkit

The Mason CLI wraps adb logcat so that you can remotely access your production devices. The command mason xray logcat gives you the power of adb across your entire fleet of devices.

Visit our CLI documentation to learn more about mason xray logcat

Collecting logs from a Production device

Using mason xray logcat on a Mason device can give you insights into CPU power states, network changes, and other details that are relevant to application performance and stability.

The logs provided by the command mason xray logcat also include logs from the applications you've deployed to your devices, helping you debug repeated crash loops or unexpected behavior.

For more detailed logs, try using the mason xray bugreport command. Visit our CLI documentation to learn more

Another common use of adb is working with the Android file system. Being based on Linux, Android follows its conventions. For example, / is the root of the file system, similar to C:/ in Windows.

You can use the Mason CLI command mason xray shell to navigate the directories on a production device.

Visit our CLI documentation to learn more about mason xray shell

Important directories to note

The /sdcard directory is where user-accessible files are stored

  • If an app takes a picture, it will be saved to /sdcard/DCIM
  • If a user downloads a file, it will be saved to /sdcard/Download
  • etc...

The /data directory is where apps store their private data

  • Authentication credentials and database configs live here
  • etc...

On a production Mason device, you will not have access to /data, even for your own app, for security reasons

Interacting with files on a Production device

X-Ray gives you the ability to put files on your devices with the mason xray push command or download files with the mason xray pull command.

Using push allows you to move files on to your production device.

Visit our CLI documentation to learn more about mason xray push

Using pull allows you to copy files from your production device.

Visit our CLI documentation to learn more about mason xray pull

Need help?