androidadbandroid-jobschedulerdumpsys

ADB shell command to cancel and remove all jobs in my app


With improper enquing jobs, there can be easily mess, is there any adb command to remove all pending and active jobs (showed by adb shell dumpsys jobscheduler)


Solution

  • To call JobScheduler.cancelAll() via adb use:

    adb shell service call jobscheduler 5
    

    For finer control use JobScheduler.cancel(int jobId):

    adb shell service call jobscheduler 4 i32 <jobId>
    

    To confirm the proper service call codes for your Android version read

    https://stackoverflow.com/a/25987165/1778421