You probably have lots of time.
Since acadamies usually have upper age limits of 35,
you are probably young enough to get in shape in a few months.
I recommend going out for five 20 minute sessions a week.
Jog until you are out of breath, switch to walking to
catch your breath, then jog again. It will probably 2 to 10 weeks
to work up to continuous running without breathing hard.
Expect soreness the first few days or weeks. But many people
find exercise changes to fun after the initial sore period
and look forward to it.
I recommend focusing on duration (20 minutes) the first few
months. Then when that becomes easy, try running faster
to make the speed test.
One caveat: I recommend a running/exercise program for the rest of
your police life. I have no sympathy for people who slack
off, then ask how they can pass such-and-such a physical
in just a few weeks. Its not fair to the public too. Maybe you only
need to chase a crook or save a victim a few times a year.
But you never know when you need to be in shape to do this-
so you should always be in shape.