Skip to content

Global method global - puppeteerApp

openApp(packageName)

Open the app

Kind: global function

ParamType
packageNamestring

openAppName(appName)

Open the app(by name)

Kind: global function

ParamType
appNamestring

closeApp(packageName)

Close the app

Kind: global function

ParamType
packageNamestring

getApps() ⇒ Array.<Object>

Get all apps

Kind: global function

getPackageName(appName) ⇒ string

Get package name

Kind: global function

ParamType
appNamestring

getApp(appName) ⇒ string

Get app name

Kind: global function

ParamType
appNamestring

version() ⇒ string

Get version information

Kind: global function

isEnabled() ⇒ string

Get version information

Kind: global function

requestPermission(options) ⇒ Promise.<boolean>

Request permission

Kind: global function

ParamTypeDefault
optionsObject
[options.timeout]number60000

back()

Back operation

Kind: global function

home()

Home screen operation

Kind: global function

recent()

Recent app operation

Kind: global function

powerDialog()

Recent app operation

Kind: global function

notificationBar()

Notification bar operation

Kind: global function

quickSettings()

Quick settings operation

Kind: global function

lockScreen()

Lock screen operation

Kind: global function

splitScreen()

Lock screen operation

Kind: global function

setVolume(volumeLevel, streamType)

Set volume

Kind: global function

ParamTypeDefault
volumeLevelnumber
streamTypenumber1

getVolume(streamType) ⇒ number

Get volume

Kind: global function

ParamTypeDefault
streamTypenumber1

startActivity(streamType) ⇒ number

Get volume

Kind: global function

ParamType
streamTypenumber

openUrl(url)

The function to open web pages, supporting both http and https protocols. If the URL doesn't start with http or https, https:// will be added. URL scheme won't be added, such as weixin://.

Kind: global function

ParamType
urlstring

encodeURIComponent(str) ⇒ string

encodeURIComponent encodes the string

Kind: global function

ParamType
strstring

encodeURI(uri, allowedChars) ⇒ string

encodeURI encodes the URL

Kind: global function

ParamType
uristring
allowedCharsstring

decodeURIComponent(str) ⇒ string

decodeURIComponent decodes the string

Kind: global function

ParamType
strstring

decodeURI(uri) ⇒ string

decodeURI decodes the URL

Kind: global function

ParamType
uristring
toast(value)

Show toast message Displays a toast message with the given value.

alert(message)Promise.<void>

Show alert dialog Displays an alert dialog containing the given message and returns a promise that resolves when the user closes the dialog.

confirm(title, [content], [callback])Promise.<boolean>

Show confirm dialog Displays a confirm dialog with the given title and content. If a callback function is provided, it will be called with the result of the dialog. If no callback function is provided, it returns a promise that resolves based on the result of the dialog.

prompt(title, [defaultValue], [callback])Promise.<string>

Show prompt dialog Displays a prompt dialog with the given title and default value. If a callback function is provided, it will be called with the result of the dialog. If no callback function is provided, it returns a promise that resolves based on the result of the dialog.

copyToClipboard(text)

Copy text to clipboard Copies the given text to the device's clipboard.

getClipboard()string

Get clipboard content Gets the current content of the device's clipboard.

toast(value)

Show toast message Displays a toast message with the given value.

Kind: global function

ParamTypeDescription
valuestringThe message to be displayed in the toast.

alert(message) ⇒ Promise.<void>

Show alert dialog Displays an alert dialog containing the given message and returns a promise that resolves when the user closes the dialog.

Kind: global function Returns: Promise.<void> - - The promise that resolves when the user closes the dialog.

ParamTypeDescription
messagestringThe message to be displayed in the alert dialog.

confirm(title, [content], [callback]) ⇒ Promise.<boolean>

Show confirm dialog Displays a confirm dialog with the given title and content.If a callback function is provided, it will be called with the result of the dialog. If no callback function is provided, it returns a promise that resolves based on the result of the dialog.

Kind: global function Returns: Promise.<boolean> - - If no callback function is provided, it returns a promise that resolves based on the result of the dialog.

ParamTypeDefaultDescription
titlestringThe title of the confirm dialog.
[content]string"''"The content displayed in the confirm dialog
[callback]functionOptional callback function that will be called with the result of the dialog.

prompt(title, [defaultValue], [callback]) ⇒ Promise.<string>

Show prompt dialog Displays a prompt dialog with the given title and default value. If a callback function is provided, it will be called with the result of the dialog. If no callback function is provided, it returns a promise that resolves based on the result of the dialog.

Kind: global function Returns: Promise.<string> - - If no callback function is provided, it returns a promise that resolves based on the result of the dialog.

ParamTypeDefaultDescription
titlestringThe title of the prompt dialog.
[defaultValue]string"''"The default value displayed in the prompt dialog.
[callback]functionOptional callback function that will be called with the result of the dialog.

copyToClipboard(text)

Copy text to clipboard Copies the given text to the device's clipboard.

Kind: global function

ParamTypeDescription
textstringThe text to be copied to the clipboard.

getClipboard() ⇒ string

Get clipboard content Gets the current content of the device's clipboard.

Kind: global function Returns: string - - the current content of the clipboard