Skip to main content
Version: 8.1.3

debug

The sos.debug API groups together methods for checking the state of remote debug mode.

note
  • This debug is not the "native debug" of the device, but rather a remote debug mode that allows you to connect to the device using Weinre.
  • State of the remote debug mode or native debug mode can be changed via Cloud Control or Rest API.

Methods

isRemoteDebugEnabled()

The isRemoteDebugEnabled() method returns the state of the Device debug mode.

isRemoteDebugEnabled(): Promise<boolean>;

onRemoteDebugChanged()

The onRemoteDebugChanged() method sets up a listener, which is called whenever the state of the Device debug mode is changed.

onRemoteDebugChanged(listener: (data: {
enabled: boolean;
}) => void): void;

Params

NameTypeDescription
listener(data: { enabled: boolean; }) => voidThe listener to be called when the state of the remote debug mode is changed.

Return value

Resolves when the listener is successfully set up.

API Example

import { sos } from '@signageos/front-applet';

void sos.onReady(async () => {
if (await sos.debug.isRemoteDebugEnabled()) {
console.log('Remote debug is turned on');
}

sos.debug.onRemoteDebugChanged((enabled) => {
console.log('Weinre debug is', { enabled });
});
});