rk ecp

Summary

External Control Protocol (ECP) commands for Roku devices.

Description

Query and control Roku devices via the External Control Protocol (ECP).

Usage

rk ecp <subcommand> [options]

Environment variables

Environment variableDescription
RK_RCE_TOKENThe Roku Cloud Emulator (RCE) token. When set, it takes precedence over the token saved by rk device set-rce-token. That suits CI, where the token comes from a masked variable.
RK_RCE_API_URLPoints rk at another RCE Core API (an https host under rce.roku.com, or 127.0.0.1, [::1] or localhost on any port, for testing). The default is https://api.rce.roku.com/api/v1. A value that is not a URL is reported by the variable's name, without echoing it.
RK_RCE_NO_LIFECYCLESet to 1 by rk server in the processes it spawns: they use running RCE devices but never start or stop one. Not meant to be set by hand.

All documented variables are listed on rk environment variables.

query/app-ui

Summary

Query the SceneGraph UI hierarchy of the running application (alias: query-ui).

Description

Query the SceneGraph UI hierarchy of the running application (alias: query-ui).

Usage

rk ecp query/app-ui [options]

Options

FlagAliasValue/typeRequired
--json—booleanno
--device—stringno
--host—stringno
--password—stringno
--output-ostringno

--json

Output in JSON format

--device

Target device (ID, IP, or name)

--host

Connect directly to a device by IPv4 or hostname

--password

Device developer password override

--output

Save output to file

See also

query/device-info

Summary

Query device information (model, serial, software version, etc.).

Description

Query device information (model, serial, software version, etc.).

Usage

rk ecp query/device-info [options]

Options

FlagAliasValue/typeRequired
--json—booleanno
--device—stringno
--host—stringno
--password—stringno
--output-ostringno
--pretty-pbooleanno

--json

Output in JSON format

--device

Target device (ID, IP, or name)

--host

Connect directly to a device by IPv4 or hostname

--password

Device developer password override

--output

Save output to file

--pretty

Human-readable key-value format

See also

keypress

Summary

Simulate pressing a remote control key.

Description

Simulate pressing a remote control key.

Usage

rk ecp keypress <KEY> [options]
ArgumentDescriptionRequiredRepeatable
KEYECP remote key name.yesno

Options

FlagValue/typeRequired
--jsonbooleanno
--devicestringno
--hoststringno
--passwordstringno

--json

Output in JSON format

--device

Target device (ID, IP, or name)

--host

Connect directly to a device by IPv4 or hostname

--password

Device developer password override

See also

input

Summary

Send custom launch parameters to the running app.

Description

Send custom launch parameters to the running app.

Usage

rk ecp input [<key=value>...] [options]
ArgumentDescriptionRequiredRepeatable
key=valueLaunch parameter key-value pair; URL-encoded automatically.noyes

Options

FlagValue/typeRequired
--devicestringno
--hoststringno
--passwordstringno
--filestringno
--jsonstringno
--uristringno

--device

Target device (ID, IP, or name)

--host

Connect directly to a device by IPv4 or hostname

--password

Device developer password override

--file

Read input parameters from JSON file

Example:

rk ecp input --file deeplink.json

--json

Input parameters as JSON string

Example:

rk ecp input --json '{"contentId":"123","mediaType":"movie"}'

--uri

Pre-encoded URI query string

Example:

rk ecp input --uri "contentId=123&mediaType=movie"

See also

capture-screen

Summary

Capture current device screen and save image to disk.

Description

Capture current device screen and save image to disk.

Usage

rk ecp capture-screen [options]

Options

FlagAliasValue/typeAllowed valuesDefaultRequired
--format—stringpng, jpegpngno
--output-ostring——no
--device—string——no
--host—string——no
--password—string——no
--json—boolean——no

--format

Screenshot format

--output

Output file path or directory

--device

Target device (ID, IP, or name)

--host

Connect directly to a device by IPv4 or hostname

--password

Device developer password override

--json

Output in JSON format

See also


Did this page help you?