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

getCurrentPackage

Get the name of the current Android package.

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

Usage
browser.getCurrentPackage()
Example
getCurrentPackage.js
it('should get the current Android package', async () => {
const pkg = await browser.getCurrentPackage()
console.log('Current package:', pkg)
})
Returns
  • <Promise<string>> returns: The name of the current Android package
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