All Products
Search
Document Center

Cloud Phone:Web SDK

Last Updated:Jun 24, 2026

The Alibaba Cloud Workspace Web SDK provides open APIs for connecting the Workspace Web Client to Elastic Desktop Service (EDS), cloud applications, and cloud phones. By integrating the SDK, you can quickly customize and build a web client tailored to your business requirements.

1. Quick start

1.1 SDK and demo

Note

By downloading and using the SDK, you agree to the Alibaba Cloud Workspace SDK Privacy Policy.

Do not distribute them to any third party without Alibaba Cloud's consent.

Directory structure

├── WuyingWebDemo.html  // A sample page demonstrating SDK usage.
├── WuyingWebSDK.js     // The SDK API file. You must reference this file in your frontend page.
└── sdk                 // Resource files for iframe embedding.
     └── ASP
          └── container.html
  • Web.SDK.Demo is a Vue project. To start the project:

    1. Check whether Node.js is installed:

      node
      • A Welcome to Node.js message indicates that Node.js is installed.

      • If you do not see this message, install Node.js.

    2. Navigate to the root directory of the Vue project:

      Note

      Replace <ProjectRootPath> with the path to the Vue project's root directory.

      cd <ProjectRootPath>
    3. Install the dependencies:

      npm i
    4. Start the project:

      npm run dev

      On success, an accessible URL is returned.

  • To start WuyingWebDemo.html:

    1. Navigate to the directory where the HTML file is located:

      Note

      Replace <HTMLPath> with the path to the HTML file's directory.

      cd <HTMLPath>
    2. Start the HTTP server:

      python3 -m http.server
    3. In your browser, open http://localhost:8000/WuyingWebDemo.html.

1.2 Integration flow

image

1.3 Best practices

See Best practices for quick integration of cloud phones. The following figure shows the integration architecture.

image

You can use multiple logon methods to obtain the ticket required by the SDK to connect to a cloud phone. The following figure shows the flowchart.

image

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

2. Lifecycle API

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 = {
  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

Set this to the constant appstream for Cloud Phone.

sessionParams

SessionParam

Yes

The parameters for creating a session. See 4.1 SessionParam.

sessionParams parameters

  • userInfo:

    • sessionId: The SessionId returned by the GetLoginToken or GetStsToken operation.

    • authCode: The authorization code obtained by calling the GetAuthCode API.

    • loginToken: The login token obtained by calling the GetLoginToken API.

Note

There are two logon methods: 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 allows you to use your own user system. The authentication parameter for logon without authorization is authCode, and 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 ultimately 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: How to open the cloud phone. See the openType enumeration in this document.

2.2 Establish a connection

session.start();

2.3 Terminate a connection

session.stop();

2.4 Callbacks

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

Parameters:

Parameter

Type

Description

name

string

The event type to listen for. See 5.9 SessionEventType.

callback

Function

The callback function.

Example:

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. API

API

Description

WebSDK.apiVersion

Returns the WebSDK version number as a string.

setInputEnabled(param: boolean)

enableInput(param: boolean)

Enables or disables input.

  • When disabled, the cloud phone does not respond to input events from the local keyboard, mouse, or touchpad.

  • enableInput and setInputEnabled have the same function. We recommend using setInputEnabled.

enableKeyBoard(param: boolean)

Enables or disables the on-screen keyboard on the cloud phone.

setClipboardEnabled(param: boolean)

Enables or disables the clipboard.

setMicrophoneEnabled(param: boolean)

Enables or disables the microphone.

setTouchEnabled(param: boolean)

Enables or disables touch input.

setUiParams(param: UiConfig)

Sets the UI configuration after a session is established, such as showing or hiding the menu and forcing landscape mode.

Note

See 4.4 UiConfig.

Example:

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

dataChannel

A custom data channel for sending and receiving data between the client and the cloud.

// Configure dataChannelConfig in sessionParam.
dataChannelConfig: [{
     dataChannelName: 'wy_vdagent_default_dc',
}
// Listen for messages on the data channel.
/** The string `value` specifies the rotation: "0" for 0°, "1" for 90°, "2" for 180°, and "3" for 270°.
  * The message format for rotation is {"action":"rotation","value":"0"}.
*/
session.addDataChannelListener('wy_vdagent_default_dc', 'data', data => console.log('data from wy_vdagent_default_dc', data));
// Send a message through the data channel.
// 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(), // A unique ID for the command.
       cmd: OperationMap[type],
     }),
 );
// Listen for the ADB command response.
session.addLyncListener('lync_adb_shell', 'onReceivedLyncData', data => console.log('data from lync_adb_shell', data));

4. Parameters

4.1 SessionParam

Parameters for creating a session.

Parameter

Type

Required

Description

openType

OpenType

Yes

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

iframeId

string

No

Required if the page is opened in an iframe.

sdkPath

string

No

The path to the SDK file. If left empty, the default relative path is used. Example: ./ASP/container.html.

resourceType

ResourceType

Yes

The resource type. Currently, only local connection pages are supported.

connectType

ConnectType

Yes

Whether to connect to a cloud phone or a cloud computer.

isOverseas

boolean

No

Whether the access is from an overseas location. Default: false.

userInfo

UserInfo

Yes

The user's authentication information.

regionId

string

Yes

Required when connecting to a cloud phone. The region where the cloud phone is located.

appInfo

AppInfo

No

Information about the application to start on the cloud phone.

fileInfo

FileInfo

No

Parameters for the cloud drive.

uiConfig

UiConfig

No

UI settings for the connection page.

logDisabled

bool

No

Whether to disable ARMS statistics. Default: false (enabled).

loginType

LoginType

No

The login method. Default: Alibaba Cloud Workspace account.

networkAccessType

string

No

The network access type, such as VPC login. Default: empty.

4.2 UserInfo

Contains the user's authentication information. Choose one of the following parameters: authCode, ticket, or loginToken. authCode is obtained from a pre-authorized login flow. loginToken is obtained from a convenience account login. You can obtain a ticket by making a request with either an authCode or a loginToken.

Parameter

Type

Required

Description

authCode

string

Yes

A one-time login credential. This parameter has the highest priority.

ticket

string

Yes

Starting from v1.4.7, you can use a ticket to connect directly.

loginToken

string

Yes

The authentication credential for a convenience account.

sessionId

string

Yes

The session ID obtained from a GetLoginToken or GetStsToken request.

4.3 AppInfo

Parameters for starting a cloud phone.

Parameter

Type

Required

Description

osType

string

Yes

Must be set to Android.

appId

string

Yes

The persistent application instance ID (PersistentAppInstanceId). Example: p-0caoet4e18cui****.

appVersion

string

No

The version of the application to start.

loginRegionId

string

Yes

The region where the cloud phone resources are located.

connConfig

ConnConfig

No

Connection configuration parameters.

appInstanceGroupId

string

No

The delivery group ID.

appInstanceId

string

No

The instance ID. Required when establishing a connection with a ticket. Example: ai-0cc7s3n1iagyq****.

taskId

string

No

The application startup task ID.

bizRegionId

string

No

The region where the application resources are located.

productType

string

No

The delivery group type. For cloud phones, this value must be AndroidCloud.

4.4 UiConfig

UI settings for the connection page.

Parameter

Type

Required

Description

toolbar

ToolBarConfig

No

Display settings for the toolbar.

exitCheck

bool

No

Whether to show a confirmation prompt when the user exits the page. Default: enabled.

rotateDegree

number

No

Force landscape mode (0: Normal; 90: Force landscape mode)

vconsoleVisiable

bool

No

Whether to display the vConsole debug box.

debugPanelVisiable

bool

No

Whether to display the debug panel with metrics such as bitrate and frame rate.

reconnectType

ReconnectType

No

The style of the reconnection prompt dialog.

defaultResolution

ResolutionType

No

The default resolution for the initial connection. Default: A.

language

Language

No

The language for internal prompts. Default: Simplified Chinese.

allowErrorDialog

bool

No

Whether to display error dialogs.

backgroundColor

string

No

Custom background color for the loading screen.

backgroundImg

string

No

Custom background image for the loading screen.

4.5 ToolBarConfig

Toolbar display settings.

Parameter

Type

Required

Description

visible

bool

No

Whether to display the toolbar.

noMenu

bool

No

Whether the DesktopAssistant can open the context menu. Default: false. Supported in v1.4.20 and later.

4.6 ConnConfig

Connection configuration parameters.

Parameter

Type

Required

Description

decodeType

ConnDecodeType (numeric enumeration)

No

The decoding method.

playSoundBackground

bool

No

Whether to continue playing sound when the application runs in the background.

5. Enumeration types

5.1 Open type

How the cloud phone session is opened.

Value

Description

newTab

Opens the session in a new browser tab.

inline

Opens the session in an embedded iframe.

urlScheme

Starts the session using the local client. Requires the Alibaba Cloud Workspace client V6.2 or later.

5.2 Connect type

Whether to start a cloud computer or a cloud phone.

Value

Description

app

Starts a cloud phone.

desktop

Starts a cloud computer.

The Cloud Phone service currently uses the app type. When you connect to a Cloud Phone, the connectType parameter is fixed to app.

5.3 Resource type

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

Value

Description

local

Opens the local connection HTML page.

The Wuying Cloud Phone integration uses the hardcoded value local.

5.4 Reconnect type

The UI style of the reconnection prompt.

Value

Description

simple

A simple loading indicator.

normal

A dialog box with a countdown timer.

5.5 Resolution type

The default resolution for the initial connection. User settings override this default.

Value

Description

A

Speed-prioritized. Uses the current window size.

B

Quality-prioritized. Uses the current window size multiplied by window.devicePixelRatio.

5.6 Charge type

The billing method for the cloud phone.

Value

Description

Supported since

PostPaid

pay-as-you-go

1.4.0

PrePaid

subscription

1.4.0

5.7 Language

The language setting. Default: zh-CN.

Value

Description

zh-CN

Simplified Chinese

en-US

English

ja-JP

Japanese

5.8 Login type

The method to log on to the cloud phone.

Value

Description

aliyunLogin

Log on with an Alibaba Cloud account.

normalLogin

Alibaba Cloud Workspace account login (Cloud Phone only supports normalLogin).

5.9 Session event type

Event types for a session, including events specific to cloud phones.

Value

Description

Supported since

getConnectionTicketInfo

Triggered when a connection to a cloud phone is initiated.

1.0.0

onConnected

Triggered when a connection to a cloud phone is established.

1.0.0

onDisConnected

Triggered when the connection to the cloud phone is terminated.

1.0.0

onRuntimeMsg

A message sent from the runtime environment to the SDK.

1.1.0

networkData

Network performance metrics.

1.3.1

onError

Triggered when an error occurs during the connection.

1.4.1

5.10 Connection decode type

The decoding type for the stream.

Value

Description

Supported since

0

software decoding

1.2.0

1

hardware decoding

1.2.0

2

WebRTC

1.2.0

5.11 Protocol type

The protocol type.

Value

Description

Supported since

ASP

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

1.3.0

HDX

Citrix protocol

1.3.0

Error codes

Errors from onDisconnected

Code

Parameter

Description

0

ASP_CLIENT_DISCONNECT_CONNECT_ERROR

Disconnected.

1

ASP_CLIENT_DISCONNECT_SOCKET_CLOSE

The socket closed.

2

ASP_CLIENT_DISCONNECT_WEBRTC_CLOSE

WebRTC closed.

25

Ticket verification failed. This error also occurs if you try to reuse a ticket from a disconnected session for a new connection.

1206

A ticket supports only one concurrent connection. This error occurs if you try to start a new connection while the cloud phone is already connected.

1207

Restarting the instance invalidates the ticket.

2000

ASP_CLIENT_DISCONNECT_OK

The cloud phone disconnected normally.

2001

ASP_CLIENT_DISCONNECT_CLOUD_APP_STOP

The cloud application closed.

2002

ASP_CLIENT_DISCONNECT_CLIENT_PREEMPTION

The current cloud phone session was preempted.

2003

ASP_CLIENT_DISCONNECT_GUEST_SHUTDOWN_REBOOT

The guest restarted.

2004

The current user disconnected.

2027

The stream pulling mode 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.

Errors from onError

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

Code

Description

AccountNotAvailable

The domain account is locked, disabled, or expired. Contact your IT administrator or domain controller administrator to resolve this.

ClientLockedForAliasFailed

You have reached the maximum number of incorrect attempts. Try again in 5 minutes.

content-monthpackageenterpostpaidphase

The subscription package for this cloud phone is exhausted for the current billing cycle. Subsequent usage will be charged on a pay-as-you-go basis.

content-recordingscreen

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

desktop-AgentUnbinding

The connection to a new temporary cloud phone failed because the previous temporary cloud phone is still disassociating. Try connecting 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 timeout. Restart the cloud phone and try connecting again.

desktop-DesktopAgentFileLose

The connection failed because a core process file of the cloud phone is missing. Restart the cloud phone and connect again. If the issue persists, contact your IT administrator.

desktop-DesktopContainSecuritySoftware

Security software installed on the cloud phone is disrupting its connection to the management service. Contact your IT administrator to disable the security software, and then try connecting again.

desktop-DesktopContainVpn

VPN software installed on the cloud phone is disrupting its connection to the management service. You can restart the cloud phone to resolve this issue. If the connection still fails, contact your IT administrator.

desktop-DesktopGuestStop

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

desktop-DesktopNetworkAnomaly

A network issue on the cloud phone has interrupted its connection to the management service. You can restart the cloud phone to resolve this issue. If the connection still fails, contact your IT administrator.

desktop-DesktopNetworkError

A network issue on the cloud phone has interrupted its connection to the management service. You can restart the cloud phone to resolve this issue. If the connection still fails, contact your IT administrator.

desktop-DesktopResourceStatusInvalid

The connection to the cloud phone failed because the underlying ECS instance is not in the "Running" state. Restart the cloud phone and try connecting again.

desktop-DesktopResourceStop

The connection to the cloud phone failed because the underlying ECS instance is stopped. Restart the cloud phone and try connecting again.

desktop-DesktopsUnderMaintenance

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

desktop-DesktopUnavailable

The connection failed. Try again later. If the issue persists, contact your IT administrator to check the status of the cloud phone.

desktop-DistributeLockFailed

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

desktop-GENERAL_ERROR

A service error occurred. Try connecting to the cloud phone again. If the issue persists, 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 for the IT administrator's account is insufficient. Contact your IT administrator for assistance.

desktop-INTERNAL_ERROR

A service error occurred. Try connecting to the cloud phone again. If the issue persists, contact your IT administrator.

desktop-InvalidBundleId.NotFound

The image template for this cloud phone is invalid. Contact your IT administrator.

desktop-InvalidClientIp.Policy

You cannot connect from your current IP address because your IT administrator has configured an IP address whitelist for this cloud phone. Contact your IT administrator for assistance.

desktop-InvalidClientType.AccessDenied

Your IT administrator has prohibited running this cloud phone on the current client. To use this cloud phone, contact your IT administrator.

desktop-InvalidDesktopId.NotFound

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

desktop-InvalidDesktopId.Status

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

desktop-InvalidDesktopStatus.NotRunning

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

desktop-InvalidDesktopStatus.NotStopped

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

desktop-InvalidDesktopStatusInvalid

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

desktop-InvalidLiteConnectionCheck

The cloud phone failed to reconnect due to a protocol service error. Try connecting again.

desktop-NoEnoughDesktops

No temporary cloud phones can be assigned due to your IT administrator's settings. Contact your IT administrator.

desktop-NotFindDesktopId

The IT administrator has released this cloud phone.

desktop-NotFoundUserDesktop

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

desktop-PermissionDeny.Desktop

Your IT administrator has revoked your permissions. To continue using the cloud phone, contact your IT administrator to restore your permissions.

desktop-RES_GW_ERROR

A service error occurred. Try connecting to the cloud phone again. If the issue persists, contact your IT administrator.

desktop-SDK.ReadTimeout

A service error occurred. Try connecting to the cloud phone again. If the issue persists, contact your IT administrator.

desktop-ServiceUnavailable

The service connection timed out. Try connecting to the cloud phone again. If the issue persists, contact your IT administrator.

desktop-THROTTLING_USER

A service error occurred. Try connecting to the cloud phone again. If the issue persists, contact your IT administrator.

desktop-UnavailableDesktop

The cloud phone logon timed out. Reconnect or restart the cloud phone to resolve this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2901

The connection to the cloud phone failed because the protocol service could not connect to the cloud environment. Restart the cloud phone to resolve 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 is not responding. Restart the cloud phone to resolve this issue. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2903

The connection to the cloud phone failed due to an issue in the cloud environment. Restart the cloud phone to resolve this. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2904

The connection to the cloud phone failed due to an issue in the cloud environment. Restart the cloud phone to resolve this. If the connection still fails, contact your IT administrator.

desktop-UnavailableDesktop.2905

The connection failed due to a timeout while logging off another session on this shared cloud phone. Reconnect to or restart the cloud phone.

desktop-UnavailableDesktop.2906

The connection failed due to a response timeout 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. Try connecting again later or restart the cloud phone. If the issue persists, 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 restore your permissions to use the cloud phone.

desktop.linux-UnavailableDesktop.AuthFailed

The connection to the cloud phone may have failed because the instance is no longer joined to the domain. Restart the cloud phone and try connecting again, or contact your IT administrator.

DesktopNetworkError.AbortBySoftware

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.BadHandShake

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.BindAddressFailed

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.ConnectAddressFailed

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.ConnectionClosedError

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.ConnectionRefusedError

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.ConnectionResetError

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.ConnectionTimeout

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.DnsLookupFailed

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.Forbidden

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.ReceivedUnexpectedEOF

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.SystemOutOfResource

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopNetworkError.UnKnowError

A network issue on the cloud phone has interrupted its connection to the management service. Restart the cloud phone to resolve this issue.

DesktopStatus-Desc-Updating

This cloud phone is temporarily unavailable while its configuration is being changed.

DesktopStatus-Repairing

Repairing.

DesktopStatus-Updating

Updating configuration.

DeviceNotInManage

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

DirectoryLoginUnsupported

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

DomainFailed

The connection to the cloud phone failed because the system could not be joined to a domain.

DomainRelationshipFailed

The connection to the cloud phone failed due to an issue with the system's domain trust relationship.

ExistedEmail

The email address is already in use. Enter a different email address.

ExistedEndUserId

The username is already in use. Enter a different username.

ExistedPhoneNumber

The phone number is already in use. Enter a different phone number.

ExpiredEmailVerifyCode

The email verification code has expired. Request a new one.

FailedToSendEmailVerifyCode

Failed to send the email verification code. Try again.

ForbidByClientVersionForBusiness

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

ForbidByPasswordPolicy

Failed to change 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 then try updating again.

FOTA_SNAPSHOT_IN_PROGRESS

The image cannot be updated because the system is creating a snapshot 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 on the cloud phone failed due to a response timeout.

GuestRebootOperateFail

Failed to restart the cloud phone.

GuestRebootOperateTimeout

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

GuestStopOperateFail

Failed to shut down the cloud phone.

GuestStopOperateTimeout

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

InvalidDirectoryType

RAM user logon is no longer supported. 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 associated with your account.

InvalidPassword

The username or password is incorrect.

LoginError.MissingConcatForVerify

You cannot complete identity verification because this is an administrator-activated account. Contact your IT administrator.

LoginForbidden

Logon failed. Trusted device authentication is enabled for the office network or organization. Contact 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, and your account is not authorized.

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 to 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. Request a new one.

PhoneIsNotRegistered

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

SessionForceQuit

You have been automatically logged off. This may be because you have logged off from another terminal, or the number of logged-on terminals exceeds the limit set by your IT administrator.

StartApplicationGuestTimeout

The application failed to start due to an unstable network connection. Try again.

StartDesktopFail

Failed to start the cloud phone.

ThrottlingSendEmailVerifyCodeLimit

You can request a verification code only once per minute.

UnavailableDesktop.2907

The connection to the cloud phone failed because the protocol service is still starting. Try connecting again later or restart the cloud phone. If the issue persists, contact your IT administrator.

FAQ

Disable the DesktopAssistant

You can disable the DesktopAssistant by initializing uiConfig when you call createSession.

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

Send ADB commands via the ASP channel

Initialize lyncChannelConfig when you call createSession.

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

To send a command, call session.sendLyncMessage. For example:

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

To receive the command's result, add a listener by calling 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

Screenshot

screencap -p /sdcard/Download/abc.png

Camera usage

  • When using the demo to connect to a cloud phone, be aware that browsers control camera permissions. For the camera to function correctly, the demo URL must start with https.

  • To use only the client's front or rear camera, use the following settings.

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

Clipboard usage

  • If the clipboard is not working:

    • Check if clipboard permissions are enabled in your browser.

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