Chuyển đến nội dung chính

getPerformanceData

Get performance data for a specific application. Returns system state information like cpu, memory, network traffic, and battery. Use getPerformanceDataTypes() to find available data types.

Note: Falls back to the deprecated Appium 2 protocol endpoint if the driver does not support the mobile: execute method.

Usage
browser.getPerformanceData(packageName, dataType, dataReadTimeout)
Parameters
NameTypeDetails
packageNamestringThe package name of the application to get performance data for
dataTypestringThe type of performance data to retrieve (e.g. cpuinfo, memoryinfo)
dataReadTimeout
optional
numberTimeout in seconds to wait for the data to be read
Example
getPerformanceData.js
it('should get performance data for an app', async () => {
// Get available data types first
const types = await browser.getPerformanceDataTypes()
// Get CPU info for an app
const cpuData = await browser.getPerformanceData('com.example.app', 'cpuinfo', 5)
})
Returns
  • <Promise<string[]>> returns: Performance data for the requested type
Support

Support for android

ghi chú

Refer to the official Appium driver documentation to see which driver versions support this command.

Welcome! How can I help?

WebdriverIO AI Copilot