问题描述
是否存在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 2020More information on how to debug WorkManager is now available in the official documentation: Debugging WorkManager.
这篇关于adb命令使用workmanager列出所有计划的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!