All Products
Search
Document Center

Cloud Phone:Web SDK

Last Updated:Dec 15, 2025

The Alibaba Cloud Workspace Web SDK provides open APIs for the web client that you can use to connect to Elastic Desktop Service (EDS) cloud computers, cloud applications, and cloud phones. By integrating the Web SDK, you can quickly customize and build a web client as needed.

1. Getting started

1.1 Get the SDK and demo

Resources

Note

All documents, SDKs, and client programs on this platform are for personal or enterprise use only. You are not allowed to distribute them to any third party without the consent of Alibaba Cloud.

Directory structure

├── WuyingWebDemo.html  // SDK sample.
├── WuyingWebSDK.js     // The SDK API file. Reference this file on the frontend page.
└── sdk                 // iframe embedded resource file
     └── ASP
          └── container.html
  • Web.SDK.Demo is a Vue project. To start the project, perform the following steps:

    1. Run the following command in the command-line interface (CLI) to check whether Node.js is installed in your local environment.

      node
      • If the Welcome to Node.js message appears, Node.js is installed.

      • If the message does not appear, you must install Node.js.

    2. Run the following command to navigate to the root directory of the Vue project.

      Note

      Replace <ProjectRootPath> with the actual path to the root directory of the Vue project.

      cd <ProjectRootPath>
    3. Run the following command to install the project dependencies.

      npm i
    4. Run the following command to start the project.

      npm run dev

      After the command runs, an accessible URL is returned.

  • To start WuyingWebDemo.html, perform the following steps:

    1. Run the following command to navigate to the directory where the HTML file is located.

      Note

      Replace <HTMLPath> with the actual path to the directory where the HTML file is located.

      cd <HTMLPath>
    2. Run the following command to start the HTTP server.

      python3 -m http.server
    3. Open http://localhost:8000/WuyingWebDemo.html in a browser.

1.2 Integration flow

image

1.3 Best practices

For more solution details, see Best practices for integrating Cloud Phone. The following figure shows the overall integration solution.

image

Multiple logon methods are available to get the ticket required for the SDK to connect to a cloud phone. The following figure shows the flowchart.

image

For the specific code, see the sample code for the lifecycle APIs.

2. Lifecycle APIs

2.1 Initialize and create a session

// Create a session using a ticket.
var userInfo = {
  ticket: 'xxx',
};
var appInfo = {
  osType: 'Android', // Required
  appId: "android", 
  appInstanceId: "ai-xxxxxx", // The appInstanceId starts with ai-.
  productType: "AndroidCloud",
  connectionProperties: JSON.stringify({ authMode: "Session" }) ,
};
var sessionParam = {
  openType: openType,
  iframeId: 'sessionIframe',
  resourceType: "local",
  connectType: 'app',
  userInfo: userInfo,
  appInfo: appInfo,
};
var wuyingSdk = Wuying.WebSDK;
session = wuyingSdk.createSession('appstream', sessionParam);
// Create a session using an authCode.
var userInfo = {
  sessionId: sessionId,
  authCode: authCode,
};
var appInfo = {
  osType: 'Android', // Required
  appId: "android", 
  resourceId: "p-xxxxxx", // The resourceId starts with p-.
  productType: "AndroidCloud",
  connectionProperties: JSON.stringify({ authMode: "Session" }) ,
};
var sessionParam = {
  openType: openType,
  iframeId: 'sessionIframe',
  resourceType: "local",
  connectType: 'app',
  userInfo: userInfo,
  appInfo: appInfo,
};
var wuyingSdk = Wuying.WebSDK;
session = wuyingSdk.createSession('appstream', sessionParam);
// Create a session using a loginToken or stsToken.
var userInfo = {
  sessionId: sessionId,
  loginToken: loginToken,
};
var appInfo = {
  osType: 'Android', // Required
  appId: "android", 
  resourceId: "p-xxxxxx", // The resourceId starts with p-.
  productType: "AndroidCloud",
  connectionProperties: JSON.stringify({ authMode: "Session" }) ,
};
var sessionParam = {
  openType: openType,
  iframeId: 'sessionIframe',
  resourceType: "local",
  connectType: 'app',
  userInfo: userInfo,
  appInfo: appInfo,
};
var wuyingSdk = Wuying.WebSDK;
session = wuyingSdk.createSession('appstream', sessionParam);

createSession parameters

Parameter

Type

Required

Description

id

string

Yes

A constant. The value is appstream for Cloud Phone.

sessionParams

SessionParam

Yes

The parameters for creating a session. For more information, see 4.1 SessionParam.

sessionParams parameters

  • userInfo:

    • sessionId: The SessionId that you get by calling GetLoginToken or GetStsToken.

    • authCode: Get this by calling the GetAuthCode API operation.

    • loginToken: Get this by calling the GetLoginToken API.

Note

Two logon methods are available: logon without authorization and logon with a convenience account. Logon with a convenience account depends on the Alibaba Cloud Workspace user system. Logon without authorization lets you use your own user system. The authentication parameter for logon without authorization is authCode. The authentication parameter for logon with a convenience account is loginToken. The ticket is the credential for connecting to an instance. Both loginToken and authCode are eventually converted into a ticket to connect to the instance. You must specify one of the following parameters: authCode, ticket, or loginToken.

  • appInfo: Information about the instance.

    • resourceId:

      • If you log on with a convenience account, you can call the DescribeUserResources operation on the client to get the `ResourceId` value.

      • If you log on without authorization, you can call the DescribeAndroidInstances operation on your server to get the `PersistentAppInstanceId` value.

    • openType: The method used to start the cloud phone. For more information, see the definition of the openType enumeration in this topic.

2.2 Establish a connection

session.start();

2.3 Terminate a connection

session.stop();

2.4 Callback description

Callback API: addHandle(name: SessionEventType, callback: Function)

Callback API parameters:

Name

Type

Description

name

string

The type of the event to listen for. For more information, see the definition of the 5.9 SessionEventType enumeration.

callback

Function

The callback function.

Sample callback code:

session.addHandle('getConnectionTicketInfo', (data) => {
  console.log(data);
});

session.addHandle('onConnected', (data) => {
  console.log('connected', data);
});

session.addHandle('onDisConnected', (data) => {
  console.log('disconnect', data);
});

session.addHandle('onRuntimeMsg', (data) => {
  document.getElementById('GuestMsgContext').value = JSON.stringify(data);
});

3. Business APIs

API

Description

WebSDK.apiVersion

Gets the current version number of the Web SDK. The type is string.

setInputEnabled(param: boolean)

enableInput(param: boolean)

Enables or disables input operations.

  • After you disable input operations, the cloud phone does not respond to input events from the local keyboard, mouse, or touchpad.

  • enableInput and setInputEnabled have the same functionality. setInputEnabled is recommended.

enableKeyBoard(param: boolean)

Specifies whether to bring up the keyboard on the mobile client.

setClipboardEnabled(param: boolean)

Specifies whether to enable clipboard control.

setMicrophoneEnabled(param: boolean)

Specifies whether to enable microphone control.

setTouchEnabled(param: boolean)

Specifies whether to enable touch control.

setUiParams(param: UiConfig)

Actively sets the UI configuration after a session is established, such as whether to display the menu or force landscape mode.

Note

For more information about UiConfig, see 4.4 UiConfig.

Sample code:

var uiConfig = {
  toolbar: {
    visible: false,
  },
  rotateDegree: 90,
};
session.setUiParams(uiConfig);

dataChannel

A custom tunnel for the client and the cloud to send and receive data.

// Configure dataChannelConfig in sessionParam.
dataChannelConfig: [{
     dataChannelName: 'wy_vdagent_default_dc',
}
// Listen for tunnel messages.
/** The meaning of value: 0 specifies 0 degrees, 1 specifies 90 degrees, 2 specifies 180 degrees, and 3 specifies 270 degrees. 
  * The format of the landscape mode message is {"action":"rotation","value":"0"}.
*/
session.addDataChannelListener('wy_vdagent_default_dc', 'data', data => console.log('data from wy_vdagent_default_dc', data));
// Send a tunnel message.
// Request parameters: channel name, message content.
session.sendDataChannelMessage('wy_vdagent_default_dc', new Uint8Array([1, 2, 3, 4]));

lyncChannel

A channel for the client to send ADB commands.

// Configure lyncChannelConfig in sessionParam.
lyncChannelConfig: [
{
    lyncChannelName: 'lync_adb_shell',
}
// Send an ADB command.
session.value.sendLyncMessage(
    'lync_adb_shell',
    JSON.stringify({
      id: Date.now(), // The unique identifier of the command to be executed.
       cmd: OperationMap[type],
     }),
 );
// Listen for the ADB command callback.
session.addLyncListener('lync_adb_shell', 'onReceivedLyncData', data => console.log('data from lync_adb_shell', data));

4. Detailed parameter descriptions

4.1 SessionParam

The parameters for creating a session.

Parameter

Type

Required

Description

openType

OpenType

Yes

Specifies whether to open the page in an embedded iframe or a new tab.

iframeId

string

No

If you open the page in an iframe, you must specify the iframeId.

sdkPath

string

No

The path of the SDK file. If you leave this parameter empty, the default relative path is used, such as ./ASP/container.html.

resourceType

ResourceType

Yes

Only opening the local connection page is supported.

connectType

ConnectType

Yes

Specifies whether to start a cloud phone or a cloud computer.

isOverseas

boolean

No

Specifies whether the access is from outside the Chinese mainland. Default value: false.

userInfo

UserInfo

Yes

The logon status information of the user.

regionId

string

Yes

Required when you start a cloud phone. The value is the region where the cloud phone is located.

appInfo

AppInfo

No

Information about the cloud phone.

fileInfo

FileInfo

No

Information about the cloud drive.

uiConfig

UiConfig

No

UI settings.

logDisabled

bool

No

Specifies whether to disable ARMS statistics. Default value: false. This value indicates that ARMS statistics are not disabled.

loginType

LoginType

No

The default logon method is to use a Alibaba Cloud Workspace account.

networkAccessType

string

No

By default, this parameter is left empty. VPC logon is supported.

4.2 UserInfo

The user's logon status information. You must specify one of the following parameters: authCode, ticket, or loginToken. The authCode is used for logon without authorization. The loginToken is used for logon with a convenience account. The ticket is gotten by calling an API with either the authCode or loginToken.

Parameter

Type

Required

Description

authCode

string

Yes

A one-time logon credential that has the highest priority.

ticket

string

Yes

For version 1.4.7 or later, you can directly pass in a ticket to establish a connection.

loginToken

string

Yes

The credential for logon with a convenience account.

sessionId

string

Yes

The SessionId that is gotten by calling GetLoginToken or GetStsToken.

4.3 AppInfo

The parameters for starting a cloud phone.

Parameter

Type

Required

Description

osType

string

Yes

The constant value is Android.

appId

string

Yes

Enter the PersistentAppInstanceId. Example: p-0caoet4e18cui****.

appVersion

string

No

The version of the application to start.

loginRegionId

string

Yes

The region where the cloud phone resource is located.

connConfig

ConnConfig

No

Connection configuration parameters.

appInstanceGroupId

string

No

The delivery group ID.

appInstanceId

string

No

The instance ID. This parameter is required if you use a ticket to establish a connection. Example: ai-0cc7s3n1iagyq****.

taskId

string

No

The application startup task ID.

bizRegionId

string

No

The region where the application resource is located.

productType

string

No

The delivery group type. For a cloud phone, the default value is AndroidCloud.

4.4 UiConfig

The UI settings for the connection page.

Parameter

Type

Required

Description

toolbar

ToolBarConfig

No

The display settings for the toolbar on the connection page.

exitCheck

bool

No

Specifies whether to enable secondary confirmation in the browser when you exit the current page. This feature is enabled by default.

rotateDegree

number

No

Specifies whether to force landscape mode. Only 0 (normal) and 90 (force landscape mode) are supported.

vconsoleVisiable

bool

No

Specifies whether to display the vconsole debug box.

debugPanelVisiable

bool

No

Specifies whether to display the information box for bitstream, frame rate, and other information.

reconnectType

ReconnectType

No

The style of the reconnection prompt box.

defaultResolution

ResolutionType

No

The default resolution for the first connection. Default value: 'A'.

language

Language

No

The language of internal pop-up prompts. Default value: Simplified Chinese.

allowErrorDialog

bool

No

Specifies whether to display an error pop-up window.

backgroundColor

string

No

A custom background for the loading process.

backgroundImg

string

No

A custom image for the loading process.

4.5 ToolBarConfig

The display settings for the toolbar.

Parameter

Type

Required

Description

visible

bool

No

Specifies whether to display the toolbar.

noMenu

bool

No

Specifies whether the DesktopAssistant supports opening the context menu. Default value: false. This feature is supported in versions 1.4.20 and later.

4.6 ConnConfig

Connection configuration parameters.

Parameter

Type

Required

Description

decodeType

ConnDecodeType (numeric enumeration)

No

The coding configuration.

playSoundBackground

bool

No

Specifies whether to continue playing sound after switching to the background.

5. Enumeration types

5.1 OpenType

The method to start a cloud phone.

Enumeration

Description

newTab

Opens in a new tab.

inline

Opens in an embedded iframe page.

urlScheme

Supports opening with a local native client. You must install Alibaba Cloud Workspace client V6.2 or later for this option.

5.2 ConnectType

Specifies whether to start a cloud computer or a cloud phone.

Enumeration

Description

app

Starts a cloud phone.

desktop

Starts a cloud computer.

Currently, the app type is reused for cloud phones. When you connect to a cloud phone, set connectType to app.

5.3 ResourceType

Specifies whether to open the local connection page or the Alibaba Cloud Workspace web client.

Enumeration

Description

local

Opens the local connection HTML page.

For cloud phone integration, set this parameter to local.

5.4 ReconnectType

The UI of the reconnection prompt pop-up window.

Enumeration

Description

simple

A simple loading style.

normal

A countdown pop-up window.

5.5 ResolutionType

The default resolution for the initial connection. If the user has set a preferred resolution, that resolution is used instead.

Enumeration

Description

A

Speed-prioritized. The current window size.

B

Quality-prioritized. The current window size multiplied by window.devicePixelRatio.

5.6 ChargeType

The billing method of the cloud phone.

Enumeration

Description

Supported versions

PostPaid

Pay-as-you-go

1.4.0 or later

PrePaid

Subscription

1.4.0 or later

5.7 Language

The language setting. Default value: zh-CN.

Enumeration

Description

zh-CN

Simplified Chinese

en-US

English

ja-JP

Japanese

5.8 LoginType

The method to log on to a cloud phone.

Enumeration

Description

aliyunLogin

Log on with an Alibaba Cloud account.

normalLogin

Log on with a Alibaba Cloud Workspace account. Cloud phones support only normalLogin.

5.9 SessionEventType

The mapping of session event types. This includes descriptions of cloud phone events.

Enumeration

Description

Supported versions

getConnectionTicketInfo

The event of connecting to a cloud phone.

1.0.0 or later

onConnected

The event of establishing a connection to a cloud phone.

1.0.0 or later

onDisConnected

The event of disconnecting from a cloud phone.

1.0.0 or later

onRuntimeMsg

A message sent from the runtime to the SDK.

1.1.0 or later

networkData

Network performance parameters.

1.3.1 or later

onError

Receives errors that occur during the connection process.

1.4.1 or later

5.10 ConnDecodeType

The decoding type of the stream.

Enumeration

Description

Supported versions

0

Software decoding

1.2.0 or later

1

Hardware decoding

1.2.0 or later

2

WebRTC

1.2.0 or later

5.11 Protocol Type

The connection protocol type.

Enumeration

Description

Supported versions

ASP

Alibaba Cloud in-house ASP protocol. Cloud phones support only the ASP protocol.

1.3.0 or later

HDX

Citrix protocol

1.3.0 or later

6. Error codes

6.1 onDisconnected: receive disconnection errors

Code

Name

Description

0

ASP_CLIENT_DISCONNECT_CONNECT_ERROR

Disconnected.

1

ASP_CLIENT_DISCONNECT_SOCKET_CLOSE

Socket closed.

2

ASP_CLIENT_DISCONNECT_WEBRTC_CLOSE

WebRTC closed.

25

Ticket verification failed. If a user is disconnected and then uses the same ticket to request a connection again, this error is also triggered.

2001

ASP_CLIENT_DISCONNECT_CLOUD_APP_STOP

The cloud application is closed.

2002

ASP_CLIENT_DISCONNECT_CLIENT_PREEMPTION

The current cloud phone is preempted.

2003

ASP_CLIENT_DISCONNECT_GUEST_SHUTDOWN_REBOOT

The guest is restarted.

2004

The current user is disconnected.

2027

The stream pulling mode is switched.

2200

ASP_CLIENT_RTT_TIMEOUT

RTT timeout.

2201

ASP_CLIENT_NET_ERROR_IO

Network I/O error.

2202

ASP_CLIENT_UPDATE_TICKET_FAILED

Failed to update the ticket.

6.2 onError: receive connection process errors

Format: {code: string, message: string, api: string}. The message parameter contains the requestId, and the api parameter specifies the request that reported the error.

Error code

Description

AccountNotAvailable

The domain account is locked, disabled, or has expired. Contact your IT administrator or system domain controller administrator to resolve the issue.

ClientLockedForAliasFailed

The maximum number of incorrect attempts is reached. Try again in 5 minutes.

content-monthpackageenterpostpaidphase

The monthly subscription package for this cloud phone has been used up. After you start or wake up the cloud phone, you will be charged on a pay-as-you-go basis.

content-recordingscreen

Your enterprise IT administrator has enabled the screen recording and audit feature for your cloud phone. All your operations in the cloud phone will be recorded. If you have any questions about the screen recording and audit feature, contact your administrator.

desktop-AgentUnbinding

The connection to the new temporary cloud phone failed because the temporary cloud phone that you previously connected to is being disassociated. Try to connect again later.

desktop-AssignUserFailed

Failed to assign the cloud phone. Try again later.

desktop-ConnectTicket.Timeout

The connection to the cloud phone failed due to a connection timeout. Restart the cloud phone and then connect again.

desktop-DesktopAgentFileLose

The connection failed because the core process file of the cloud phone is lost. Restart the cloud phone and connect again. If the connection still fails, contact your IT administrator.

desktop-DesktopContainSecuritySoftware

The network of this cloud phone is abnormal because security software is installed. The connection between the cloud environment and the management service is interrupted. Contact your IT administrator to exit the security software and then connect again.

desktop-DesktopContainVpn

The network of this cloud phone is abnormal because VPN software is installed. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-DesktopGuestStop

The connection failed because this cloud phone is not in the "Running" state.

desktop-DesktopNetworkAnomaly

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-DesktopNetworkError

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-DesktopResourceStatusInvalid

The connection to the cloud phone failed because the Elastic Compute Service (ECS) instance is not in the running state. Restart the cloud phone and then connect again.

desktop-DesktopResourceStop

The connection to the cloud phone failed because the ECS instance is shut down. Restart the cloud phone and then connect again.

desktop-DesktopsUnderMaintenance

The connection failed because this cloud phone is not in the "Running" state.

desktop-DesktopUnavailable

The connection failed. Try again later. If the connection still fails, contact your IT administrator to update the status of this cloud phone.

desktop-DistributeLockFailed

The connection failed because too many users are connecting to the temporary cloud phone. Try to connect again later.

desktop-GENERAL_ERROR

A service error occurred. Reconnect to the cloud phone. If the connection still fails, contact your IT administrator.

desktop-GET_TICKET_LOCK

Cloud phone connection requests are too frequent. Try again later.

desktop-INSUFFICIENT_QUOTA

No temporary cloud phone is available because the cloud phone quota under the IT administrator account is insufficient. Contact your IT administrator for O&M assistance.

desktop-INTERNAL_ERROR

A service error occurred. Reconnect to the cloud phone. If the connection still fails, contact your IT administrator.

desktop-InvalidBundleId.NotFound

The image template of this cloud phone is abnormal. Contact your IT administrator.

desktop-InvalidClientIp.Policy

You cannot connect to this cloud phone in your current IP environment because the IT administrator has configured an IP address whitelist policy. Contact your IT administrator.

desktop-InvalidClientType.AccessDenied

The IT administrator has prohibited running this cloud phone in this client. To continue using this cloud phone, contact your IT administrator.

desktop-InvalidDesktopId.NotFound

The IT administrator has revoked your permission to use this cloud phone.

desktop-InvalidDesktopId.Status

The connection failed because this cloud phone is not in the "Running" state.

desktop-InvalidDesktopStatus.NotRunning

Failed to shut down the cloud phone due to a server error. Try again later or contact your IT administrator.

desktop-InvalidDesktopStatus.NotStopped

Failed to start the cloud phone due to a server error. Try again later or contact your IT administrator.

desktop-InvalidDesktopStatusInvalid

The connection failed because this cloud phone is not in the running state.

desktop-InvalidLiteConnectionCheck

The reconnection to the cloud phone failed due to a protocol service error. Try to connect again.

desktop-NoEnoughDesktops

No temporary cloud phone can be assigned due to the settings of the IT administrator. Contact your IT administrator.

desktop-NotFindDesktopId

This cloud phone has been released by the IT administrator.

desktop-NotFoundUserDesktop

The IT administrator has revoked your permission to use this cloud phone.

desktop-PermissionDeny.Desktop

The IT administrator has revoked your permissions. To continue using the cloud phone, contact your IT administrator to grant the permissions again.

desktop-RES_GW_ERROR

A service error occurred. Reconnect to the cloud phone. If the connection still fails, contact your IT administrator.

desktop-SDK.ReadTimeout

A service error occurred. Reconnect to the cloud phone. If the connection still fails, contact your IT administrator.

desktop-ServiceUnavailable

The service connection timed out. Reconnect to the cloud phone. If the connection still fails, contact your IT administrator.

desktop-THROTTLING_USER

A service error occurred. Reconnect to the cloud phone. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop

The cloud phone logon timed out. You can reconnect to or restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2901

The connection to the cloud phone failed because the connection between the protocol service and the cloud environment failed. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2902

The connection to the cloud phone failed because the protocol service did not respond. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2903

The connection to the cloud phone failed due to an error in the cloud environment. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2904

The connection to the cloud phone failed due to an error in the cloud environment. You can restart the cloud phone to fix this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2905

The connection failed because a timeout occurred when logging off from the session for another user. This is because this cloud phone is assigned to multiple users. Reconnect to or restart the cloud phone.

desktop-UnavailableDesktop.2906

The connection failed because a response timeout occurred during system logon. Reconnect to or restart the cloud phone. 

desktop-UnavailableDesktop.2907

The connection to the cloud phone failed because the protocol service is still starting. Reconnect later or restart the cloud phone. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.NotRegistered

The IT administrator has deleted this cloud phone.

desktop-UnavailableDesktop.ServerNotReady

The connection failed due to an error during system logon. Contact your IT administrator to grant the permissions to use the cloud phone again.

desktop.linux-UnavailableDesktop.AuthFailed

The connection to the cloud phone may have failed due to a domain detachment issue. Restart the cloud phone and then connect again, or contact your IT administrator.

DesktopNetworkError.AbortBySoftware

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.BadHandShake

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.BindAddressFailed

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.ConnectAddressFailed

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.ConnectionClosedError

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.ConnectionRefusedError

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.ConnectionResetError

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.ConnectionTimeout

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.DnsLookupFailed

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.Forbidden

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.ReceivedUnexpectedEOF

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.SystemOutOfResource

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopNetworkError.UnKnowError

The network of this cloud phone is abnormal. The connection between the cloud environment and the management service is interrupted. You can restart the cloud phone to fix this issue.

DesktopStatus-Desc-Updating

The configuration of this cloud phone is being changed. The cloud phone is temporarily unavailable.

DesktopStatus-Repairing

Repairing

DesktopStatus-Updating

Upgrading/Downgrading

DeviceNotInManage

Logon failed. Trusted device authentication is enabled for the office network or organization. Ask the administrator to disable trusted device authentication or manually add the current terminal as a trusted device.

DirectoryLoginUnsupported

The entered information is incorrect. Use the organization ID to log on.

DomainFailed

The connection to the cloud phone failed because the system failed to be added to a domain.

DomainRelationshipFailed

The connection to the cloud phone failed due to an abnormal system domain relationship.

ExistedEmail

The email address is already in use. Enter another email address.

ExistedEndUserId

The username is already in use. Enter another username.

ExistedPhoneNumber

The mobile number is already in use. Enter another mobile number.

ExpiredEmailVerifyCode

The email verification code has expired. Get it again.

FailedToSendEmailVerifyCode

Failed to get the email verification code. Try again.

ForbidByClientVersionForBusiness

The organization ID is for a business edition. You must upgrade the current client to the latest version to log on.

ForbidByPasswordPolicy

Failed to modify the password. Your IT administrator has disabled the "Change Logon Password" feature.

FOTA_DESKTOP_IN_USE

The cloud phone "%s" is in use. Disconnect from it and try to update again.

FOTA_SNAPSHOT_IN_PROGRESS

The image cannot be updated because a system snapshot is being created for the cloud phone "%s". Try again later.

GuestOperateDesktopFail

Failed to shut down or restart the cloud phone.

GuestOperateDesktopTimeout

The shutdown or restart operation you performed in the cloud phone failed due to a response timeout.

GuestRebootOperateFail

Failed to restart the cloud phone.

GuestRebootOperateTimeout

The restart operation you performed in the cloud phone failed due to a response timeout.

GuestStopOperateFail

Failed to shut down the cloud phone.

GuestStopOperateTimeout

The shutdown operation you performed in the cloud phone failed due to a response timeout.

InvalidDirectoryType

The RAM user is offline. Contact your IT administrator.

InvalidEmailVerifyCode

The email verification code is incorrect. Enter it again.

InvalidMfaDeviceStatus

The virtual multi-factor authentication device is invalid. Use the device that is associated with your account.

InvalidPassword

The username or password is incorrect.

LoginError.MissingConcatForVerify

Identity verification cannot be completed because this account is an administrator-activated account. Contact your IT administrator.

LoginForbidden

Logon failed. Trusted device authentication is enabled for the office network or organization. Ask the administrator to disable trusted device authentication or manually add the current terminal as a trusted device.

LoginForbidden.LockedByAdmin

The convenience account is locked. Contact your IT administrator to manually unlock it.

LoginForbiddenByDevice

Logon failed. The administrator has specified that this terminal can only be logged on by specific users. The current account is not within the specified range.

LoginForbiddenByUntrustedDevice

Logon failed. The administrator has enabled "Block Logons of Untrusted Terminals". The administrator needs to add this terminal as a trusted device or disable this feature.

LoginForbiddenByUser

Logon failed. The administrator has enabled user logon terminal restrictions. Log on from a specified terminal.

MfaClientNotSupport

The client version is too old and does not support this multi-factor authentication method. Upgrade the client.

MfaNotAllowed

Your account lacks the information required for this multi-factor authentication method. Contact your IT administrator to add the information.

MfaTypeNotAllowed

Your IT administrator has not enabled this multi-factor authentication method.

MfaUserGoingToBeLocked

The verification code is incorrect. If you enter an incorrect code 10 consecutive times, your account will be locked for 20 minutes.

MfaUserNotExist

This account has been deleted. Contact your IT administrator for details.

MfaVerifyCodeDiscarded

The verification code is invalid. Get it again.

PhoneIsNotRegistered

The mobile number is incorrect, or the administrator has not associated the mobile number with the account.

SessionForceQuit

You have been automatically logged off. Cause: You have logged off from another terminal, or the number of logon terminals exceeds the limit set by the IT administrator.

StartApplicationGuestTimeout

The network signal is unstable, and the application failed to start. Try again.

StartDesktopFail

Failed to start the cloud phone.

ThrottlingSendEmailVerifyCodeLimit

You can send a verification code only once per minute.

UnavailableDesktop.2907

The connection to the cloud phone failed because the protocol service is still starting. Reconnect later or restart the cloud phone. If the connection still fails, contact your IT administrator.

7. FAQ

How do I disable the DesktopAssistant?

You can disable the DesktopAssistant when you initialize uiConfig during the session creation (createSession) phase.

uiConfig: {
  toolbar: {
    visible: false,
  },
},

How do I send an ADB command through the ASP channel?

You can initialize lyncChannelConfig when you create a session (createSession).

lyncChannelConfig: [
  {
    lyncChannelName: "lync_adb_shell",
  },
],

When you need to send a command, you can call session.sendLyncMessage, for example:

session.sendLyncMessage(
    "lync_adb_shell",
    JSON. stringify({
        id: crypto. randomUUID(), 
        cmd: 'input keyevent KEYCODE_VOLUME_UP',
    })
);

To receive the result of the command execution, you can add a listener session.addLyncListener, for example:

session.addLyncListener('lync_adb_shell', 'onReceivedLyncData', data => console.log('data from lync_adb_shell', data));

Common commands:

Feature

Command

Back key

input keyevent KEYCODE_BACK

Home key

input keyevent KEYCODE_HOME

Switch key

input keyevent KEYCODE_APP_SWITCH

Mute

input keyevent 164

Volume up

input keyevent KEYCODE_VOLUME_UP

Volume down

input keyevent KEYCODE_VOLUME_DOWN

Hide navigation bar

setprop persist.wy.hasnavibar false; killall com.android.systemui

Show navigation bar

setprop persist.wy.hasnavibar true; killall com.android.systemui

Take a screenshot

screencap -p /sdcard/Download/abc.png

FAQ about camera usage

  • When you use the demo to connect to a cloud phone, the browser controls camera permissions. Therefore, the demo URL must start with https to use the camera correctly.

  • In special use cases, such as when only the front or rear camera on the client is required, you must apply the following settings.

// Front camera
session.setLocalConfig('setCameraType', 1);
// Rear camera
session.setLocalConfig('setCameraType', 2);

FAQ about clipboard usage

  • The clipboard is not working

    • Check whether the clipboard permission is enabled in the browser.

    • In the Cloud Phone console, check the policy associated with the instance to confirm that the clipboard policy is enabled for bidirectional transfer.