Taking short breaks might help you stay more focused.
Do you have any alternatives, things to do to take a short break without your phone? I would advise something that includes moving, like take a short walk (even to the coffee machine or the restroom).
It helps me to decide upfront how to spend my breaks.
The pomodoro technique (mentioned below) might help too.