Any iOS developers here? A quick question.
Any iOS developers here? A quick question.
Author
Discussion

MitchT

Original Poster:

17,175 posts

240 months

Sunday 11th March 2018
quotequote all
Short version:

Is it possible to make a very simple iOS app that will make your phone fully shut down and restart again without any of the physical buttons having to be pressed, or maybe by making a button other than the power button take on the power button's role?

Long version:

I'm running an ageing iPhone 4S. I can't afford a new phone so I'm sticking with it for the foreseeable future. Only issue is that the power button has stopped working so there's no way to turn it off or on. This wouldn't be an issue but sometimes it loses signal and the only way to get the signal back is to turn it off and on again. Occasionally putting it into airplane mode and then back to normal kicks it back into touch, but usually this doesn't work. Going into Accessibility and selecting bold text causes it to do a soft reboot, but that isn't enough to make the signal come back - it needs a full shut down and restart. Going into Accessibility and turning on Assistive Touch provides a variety of on-screen options for things that are only usually accessible via the buttons, including locking the screen which, if you hold it down, launches the shut down slider, so you can turn the phone off without the power button, but the only way to power the phone up again then is to connect it to a charger - no use if you're out somewhere!

So... is it possible to make a very simple iOS app that will make your phone fully shut down and restart again without any of the physical buttons having to be pressed, or maybe by making a button other than the power button take on the power button's role?

Hoofy

80,210 posts

313 months

Sunday 11th March 2018
quotequote all
Could try selecting a different network (which will fail) then going back to the one you subscribe to?

silent k

783 posts

262 months

Sunday 11th March 2018
quotequote all
I wouldn’t think so, it’s not the sort of thing that Apple would give access to with code. It would create all sorts of issues if an app could reboot a phone.

akirk

5,778 posts

145 months

Monday 12th March 2018
quotequote all
get a battery pack to solve the charger need when out and about

thebraketester

15,878 posts

169 months

Monday 12th March 2018
quotequote all
Get the button replaced so that it works?

MitchT

Original Poster:

17,175 posts

240 months

Monday 12th March 2018
quotequote all
Selecting a different network, or maybe even just turning cellular data off and on again might do it - hadn't thought of those. I can quite understand why Apple wouldn't want developers to have access to the fundamental infrastructure of the phone. I have a battery pack, it's just a bit of a nuisance to have to carry it and the cable around. Getting the button fixed is an option though having watched a YouTube video showing how to do it, it looks like a very fiddly process and might not be worth what it's going to me to pay someone for such a complicated undertaking. I replaced a screen and battery on a 3GS before so I've already an idea of the challenge of fixing iPhones, hence why I think the button replacement looks a tad more tricky than I want to take on.

thebraketester

15,878 posts

169 months

Monday 12th March 2018
quotequote all
Take it to one of those phone fix places. They will do it for you.

ecs

1,453 posts

201 months

Monday 12th March 2018
quotequote all
I'm an iOS developer - there isn't a public API for powering off the phone meaning you couldn't build an app like this, you could probably do it on a Jailbroken phone though.

Durzel

13,032 posts

199 months

Monday 12th March 2018
quotequote all
The only way you could do this would be by exploiting some kind of buffer overrun in whatever iOS version you're running, assuming it's not been patched. Even then it would only soft-reboot or respring, which wouldn't help you.

CzechItOut

2,156 posts

222 months

Monday 12th March 2018
quotequote all

MitchT

Original Poster:

17,175 posts

240 months

Monday 12th March 2018
quotequote all
CzechItOut said:
I'm using that to put the phone to sleep and it can also be used to turn it fully off, but there's then no way to turn it on again unless you have a charger.