OnePlus 5 is been considered as one of the best phones of 2018. However, there's one issue that the users have been complaining about. the problem is that the OnePlus 5 turns off at random times without manually switching it off. this is not something normal and it means there's a problem that needs to be fixed. Below I’ll justify how you'll be able to fix the OnePlus 5 switching off and restarting randomly.
Factory Reset OnePlus 5
The first answer that i will be able to recommend that you simply will use to resolve the problem of OnePlus 5 randomly switching off/on is to factory reset the OnePlus 5. you'll be able to make use of this detailed guide how to factory reset the OnePlus 5. It’s necessary to let you know that you simply should backup all your important files and date before you begin this method to prevent losing data.
Clear Cache on OnePlus 5
After carrying out the method above, you should also try to wipe the cache partition of your OnePlus 5. With the power off, at the same time press and hold the following 3 keys: Volume Down, Power and home. when the phone begins to boot you can release the buttons. You’ll need to use the volume keys to make your choices, and the power key to confirm. choose Wipe Cache partition and confirm, then reboot the device.
If the problem persists after trying the 2 ways explained above, i will be able to advise that you simply check if your OnePlus 5 is still under warranty so that you'll be able to get a new one if proven defective by a technician.