packages/appium/docs/en/reference/api/mjsonwp.md
The following is a list of legacy Mobile JSON Wire Protocol (MJSONWP) endpoints supported in Appium.
GET /session/:sessionId/rotation
MJSONWP documentation: Device Rotation
Retrieves the current spatial orientation of the device under test.
Rotation - an object with the following properties:
| Name | Description | Type |
|---|---|---|
x | Degrees by which the device is rotated on its X axis | number |
y | Degrees by which the device is rotated on its Y axis | number |
z | Degrees by which the device is rotated on its Z axis | number |
POST /session/:sessionId/rotation
MJSONWP documentation: Device Rotation
Sets the spatial orientation of the device under test.
| Name | Description | Type |
|---|---|---|
x | Degrees by which the device is rotated on its X axis | number |
y | Degrees by which the device is rotated on its Y axis | number |
z | Degrees by which the device is rotated on its Z axis | number |
null
GET /session/:sessionId/context
MJSONWP documentation: Webviews and Other Contexts
Retrieves the active application context.
string - the name of the active context
POST /session/:sessionId/context
MJSONWP documentation: Webviews and Other Contexts
Sets an application context as the active context.
| Name | Description | Type |
|---|---|---|
name | Name of the context to set as the active one | string |
null
GET /session/:sessionId/contexts
MJSONWP documentation: Webviews and Other Contexts
Retrieves all available application contexts.
string[] - the names of available contexts
GET /session/:sessionId/network_connection
MJSONWP documentation: Device Modes
Retrieves the current state of network types (data, Wi-Fi, airplane mode).
!!! warning "Deprecated"
Please use driver-specific extension methods such as `mobile: getConnectivity`
NetworkConnectionState - a number indicating the current network state:
| Value | Data | Wi-Fi | Airplane Mode |
|---|---|---|---|
0 | OFF | OFF | OFF |
1 | OFF | OFF | ON |
2 | OFF | ON | OFF |
4 | ON | OFF | OFF |
6 | ON | ON | OFF |
POST /session/:sessionId/network_connection
MJSONWP documentation: Device Modes
Sets the state of network types (data, Wi-Fi, airplane mode).
!!! warning "Deprecated"
Please use driver-specific extension methods such as `mobile: setConnectivity`
| <div style="width:6em">Name</div> | Description | <div style="width:18em">Type</div> |
|---|---|---|
parameters | Object containing the type key, whose value is the desired network state | {"type": NetworkConnectionState} |
NetworkConnectionState - the new network state