Skip to main content
Version: 8.9.0

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>;

Return value​

Resolves to true if the remote debug mode is enabled, otherwise false.

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​

NameTypeRequiredDescription
listener(data: { enabled: boolean; }) => void
Yes
The 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 });
});
});