The app is called Lock me out it is available for Android, don’t know about iphone. But you should use it lock your phones for hours to avoid relapse
I already use it. I locked my phone for 8 hrs straight daily (the time devoted to studies).
But, this was 3-4 weeks ago, I have gradually grown. I have learnt be at ease with the urge to use them. Presently I use it only for its statistics, as a reminder.
I personally feel that it is a great way to free oneself from phone addiction. At the end of the day, however, it is about you and your control. You have got to learn it one way or other.