adb命令使用workmanager列出所有计划的工作 [英] adb command to list all scheduled work using workmanager

查看:287
本文介绍了adb命令使用workmanager列出所有计划的工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在adb shell(dumpsys)命令,该命令将提供有关使用workmanager-PeriodicWorkRequest计划的所有任务的详细信息

Is there a adb shell (dumpsys) command that will give a detailed info of all the tasks scheduled using workmanager - PeriodicWorkRequest

基本上,我有一个计划任务,应该每天运行.如何使用adb安排下一个任务?

Basically I have a scheduled task which should run daily. How do I get when Is the next task scheduled using adb.

adb shell dumpsys alarm package.name将使用workmanager列出我的计划工作

Will adb shell dumpsys alarm package.name list my scheduled work using workmanager

推荐答案

鉴于WorkManager将所有WorkRequest存储在Room数据库中,您的赌注是检索该数据库并对其进行调查.

Given that WorkManager stores all the WorkRequest in a Room database, your bet bet is to retrieve that DB and look into it.

就我所知,对于adb,最好的选择是使用JobScheduler可用的版本(WorkManager用于API级别23+设备):

For adb as far as I know, your best bet is to use what is available for JobScheduler (that WorkManager uses for API Level 23+ devices):

adb shell dumpsys jobscheduler

此处回答.

2020年1月更新 现在,官方文档中提供了有关如何调试WorkManager的更多信息:调试WorkManager .

Update January 2020 More information on how to debug WorkManager is now available in the official documentation: Debugging WorkManager.

这篇关于adb命令使用workmanager列出所有计划的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆