What tools are available to test JobScheduler?

前端 未结 4 1914
我寻月下人不归
我寻月下人不归 2020-12-04 08:20

We\'re implementing a Job via JobScheduler for background loading of data. The job will fire about once a day. What tools are available for us to test this functionality (po

4条回答
  •  情话喂你
    2020-12-04 08:57

    Starting in Android 7.0, there is a new cmd for adb shell. And in 7.1 (only in preview right now), the adb shell cmd jobscheduler has been added as you can see here to force run your JobScheduler. The helps says:

    Job scheduler (jobscheduler) commands: help Print this help text.

    run [-f | --force] [-u | --user USER_ID] PACKAGE JOB_ID Trigger immediate execution of a specific scheduled job. Options: -f or --force: run the job even if technical constraints such as connectivity are not currently met -u or --user: specify which user's job is to be run; the default is the primary or system user

提交回复
热议问题