Global method global - puppeteerApp
openApp(packageName)
Open the app
Kind: global function
Param | Type |
---|---|
packageName | string |
openAppName(appName)
Open the app(by name)
Kind: global function
Param | Type |
---|---|
appName | string |
closeApp(packageName)
Close the app
Kind: global function
Param | Type |
---|---|
packageName | string |
getApps() ⇒ Array.<Object>
Get all apps
getPackageName(appName) ⇒ string
Get package name
Kind: global function
Param | Type |
---|---|
appName | string |
getApp(appName) ⇒ string
Get app name
Kind: global function
Param | Type |
---|---|
appName | string |
version() ⇒ string
Get version information
isEnabled() ⇒ string
Get version information
requestPermission(options) ⇒ Promise.<boolean>
Request permission
Kind: global function
Param | Type | Default |
---|---|---|
options | Object | |
[options.timeout] | number | 60000 |
back()
Back operation
home()
Home screen operation
recent()
Recent app operation
powerDialog()
Recent app operation
notificationBar()
Notification bar operation
quickSettings()
Quick settings operation
lockScreen()
Lock screen operation
splitScreen()
Lock screen operation
setVolume(volumeLevel, streamType)
Set volume
Kind: global function
Param | Type | Default |
---|---|---|
volumeLevel | number | |
streamType | number | 1 |
getVolume(streamType) ⇒ number
Get volume
Kind: global function
Param | Type | Default |
---|---|---|
streamType | number | 1 |
startActivity(streamType) ⇒ number
Get volume
Kind: global function
Param | Type |
---|---|
streamType | number |
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
Param | Type |
---|---|
url | string |
encodeURIComponent(str) ⇒ string
encodeURIComponent encodes the string
Kind: global function
Param | Type |
---|---|
str | string |
encodeURI(uri, allowedChars) ⇒ string
encodeURI encodes the URL
Kind: global function
Param | Type |
---|---|
uri | string |
allowedChars | string |
decodeURIComponent(str) ⇒ string
decodeURIComponent decodes the string
Kind: global function
Param | Type |
---|---|
str | string |
decodeURI(uri) ⇒ string
decodeURI decodes the URL
Kind: global function
Param | Type |
---|---|
uri | string |
- 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
Param | Type | Description |
---|---|---|
value | string | The 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.
Param | Type | Description |
---|---|---|
message | string | The 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.
Param | Type | Default | Description |
---|---|---|---|
title | string | The title of the confirm dialog. | |
[content] | string | "''" | The content displayed in the confirm dialog |
[callback] | function | Optional 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.
Param | Type | Default | Description |
---|---|---|---|
title | string | The title of the prompt dialog. | |
[defaultValue] | string | "''" | The default value displayed in the prompt dialog. |
[callback] | function | Optional 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
Param | Type | Description |
---|---|---|
text | string | The 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