Develop
Develop
Select your platform

Horizon Platform SDK on Meta Spatial Simulator - Command-line Interface (CLI)

Updated: Jan 8, 2026
In addition to calling Platform SDK APIs, one can interact with the environment via a command-line interface (CLI). These CLI commands reduce friction when testing Platform SDK features on Meta Spatial Simulator.
The commands use adb to broadcast intents to a broadcast receiver running in Spatial Simulator.
The commands are formatted in the following manner:
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND "<COMMAND_NAME>" --es PARAMS '<COMMAND_PARAMS>'
Note that certain commands expect JSON object strings in the parameters. To improve readability, variables can be used to store parameters in the suggested usage examples. See example:
PARAMS='{"sku": "<SKU>", "price":{"amount_in_hundredths": 350, "currency": "USD", "formatted": "$3.50"}, "name": "my_product", "type": "CONSUMABLE"}'
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver \
  --es COMMAND "iap.create_product" --es PARAMS '$PARAMS'
The result of each command is embedded in the Broadcast result data.
Example:
Broadcast completed: result=0, data="{"message":"Product created with sku: 123456789"}"
Errors are also embedded in the Broadcast result data:
Broadcast completed: result=0, data="{"error":"Failed to decode product: Field 'sku' is required for type with serial name 'horizon.platform.service.iap.transport.v1.Product', but it was missing at path: $"}"

CLI commands

common.reset_data

Purpose: Resets the spatial simulator data catalog to default/original state
Parameters: N/A
Example usage:
adb shell "am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND \"common.reset_data\""

group_presence.join_intent_received

Purpose: Triggers event for GroupPresence.JoinIntentReceived with parameters
Parameters: JSON object with deeplink message, destination API name, lobby session ID, and match session ID
Example usage:
adb shell "am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND \"group_presence.join_intent_received\" --es PARAMS '{\"deeplink_message\":\"destination3_deeplink_message\",\"destination_api_name\":\"destination3\",\"lobby_session_id\":\"7a8b-zv73\",\"match_session_id\":\"123\"}'"

application_lifecycle.launch_intent_changed

Purpose: Triggers event for ApplicationLifecycle.LaunchIntentChanged with parameters
Parameters: JSON object with deeplink message, destination API name, launch source, type, tracking ID, and users
Example usage:
adb shell "am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND \"application_lifecycle.launch_intent_changed\" --es PARAMS '{\"deeplink_message\":\"horizon://worlds/10235735230144318\",\"destination_api_name\":\"world_name\",\"launch_source\":\"DIRECT_DESTINATION\",\"type\":\"DEEPLINK\",\"tracking_id\":\"1010\",\"users\":[{\"id\":\"121212\",\"display_name\":\"Bobby\"}]}'"

group_presence.get

Purpose: Get the group presence information for a given user. The group presence can be set using Platform SDK APIs, see GroupPresence.
Parameters: User ID (string). If null, gets the group presence information for the logged in user.
Example usage:
# Get the logged in user group presence
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND "group_presence.get"

# Get the group presence for a specific user ID
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND "group_presence.get" --es PARAMS "084275158957381"

leaderboards.create_leaderboard

Purpose: Creates a leaderboard
Parameters: JSON object string with the following fields:
Field NameField TypeRequired
id
string
Yes
api_name
string
Yes
Example usage:
PARAMS='{"id": "<LEADERBOARD_ID>", "api_name": "<LEADERBOARD_NAME>"}'
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver \
  --es COMMAND "leaderboards.create_leaderboard" --es PARAMS '$PARAMS'

users.create_user

Purpose: Creates a user.
Parameters: JSON object string with the following fields:
Field NameField TypeRequired
id
string
Yes
display_name
string
No
alias
string
No
presence
string
No
presence_deeplink_message
string
No
presence_destination_api_name
string
No
presence_lobby_session_id
string
No
presence_match_session_id
string
No
presence_status
“ONLINE” / “OFFLINE”
No
profile_url_small
string
No
Example usage:
adb shell "am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND \"users.create_user\" --es PARAMS '{\"id\":\"<USER_ID>\"}'"

iap.create_product

Purpose: Creates a new product
Parameters: JSON object string with the following fields:
Field NameField TypeRequired
sku
string
Yes
type
“DURABLE”, “CONSUMABLE”, “SUBSCRIPTION”
Yes
name
string
Yes
price
Price
Yes
cover_url
string
No
description
string
No
icon_url
string
No
short_description
string
No
billing_plans
BillingPlan[]
No
Price:
Field NameField TypeRequired
amount_in_hundredths
Long
Yes
currency
string
Yes
formatted
string
Yes
Example usage:
PARAMS='{"sku": "<SKU>", "price":{"amount_in_hundredths": 350, "currency": "USD", "formatted": "$3.50"}, "name": "my_product", "type": "CONSUMABLE"}'
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver \
  --es COMMAND "iap.create_product" --es PARAMS '$PARAMS'

users.block_user

Purpose: Blocks a user given the “id” of the user and has to exist and not be blocked already
Parameters: User ID (string)
Example usage:
adb shell "am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND \"users.block_user\" --es PARAMS '<USER_ID>'"

users.unblock_user

Purpose: Unblocks a previously blocked user given the “id” of the user
Parameters: User ID (string)
Example usage:
adb shell "am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND \"users.unblock_user\" --es PARAMS '<USER_ID>'"

common.all_change_page_size_limit

Purpose: Changes all APIs page size limit
Parameters: Page size (int)
Example usage:
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND "common.all_change_page_size_limit" --es PARAMS 10

application.invite_accept

Purpose: Accepts application invite on behalf of the recipient
Parameters: Application invite ID (string)
Example usage:
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND "application.invite_accept" --es PARAMS '<application_invite_id>'

application.invite_decline

Purpose: Rejects application invite on behalf of the recipient
Parameters: Application invite ID (string)
Example usage:
adb shell am broadcast -n horizon.platform.spatialsim/.CommandReceiver --es COMMAND "application.invite_decline" --es PARAMS '<application_invite_id>'
Did you find this page helpful?