getAllAppServices
API_LEVEL
3.0
开始支持,API 兼容性请参考 API_LEVEL。
获取当前应用在运行的设备应用服务列表,用于查询服务状态。
信息
权限代码: device:os.bg_service
类型
function getAllAppServices(): Result
参数
Result
类型 | 说明 |
---|---|
Array<string> | 获取当前正在运行的设备应用服务列表 |
代码示例
import { getAllAppServices } from '@zos/app-service'
const serviceList = getAllAppServices()
console.log(serviceList)