You can do this but you have to remove the battery and hook up the circuitry to external power. This practically turns the phone into a glorified SBC. It may still be worth it since there's more of a mass market for phones than SBCs (and phones come with lots of extra hardware components that can be useful) but it's not that huge of a win.