I setup my iPhone to automatically shutdown every night to save battery life

Welcome to our Community
Wanting to join the rest of our members? Feel free to sign up today.
Sign up

bigviking

New Member
Bronze
Jul 4, 2007
60
0
0
#1
Last night I had a thought that it would be nice to have my iPhone turn itself off at the same time every night in order to save battery life.

I have written a command line program that can be used to shutdown or reboot your iPhone, and included some instructions that show how to setup the scheduler (cron) to automatically shutdown your iPhone every night.

Anyone that is interested in this can download the software from http://dave.henriksen37.googlepages.com/iPhonesoftware
 

seb481

New Member
Silver
Aug 3, 2007
774
1
0
San Diego
#2
That's great but can't you just turn off the iPhone yourself? I mean, it takes about 2 seconds. Besides, I don't go to bed at the same time every night and sometimes I want my phone to be on all night long. Anyways. Good job on the program though, I could not do such a job so I have to respect your work :)
 

OJsakila

New Member
Jul 15, 2007
3,021
1
0
Jupiter's sulphur mines
#4
hey good work. Pretty cool, dude. I leave mine on 24/7, however. Never know when I might get THAT call... Plus my battery is the apparently the only battery with zero problems. The thing lasts forever....
 

SCMedic

New Member
Bronze
Jul 7, 2007
95
0
0
#5
Nice little script, but seriously, the button doesn't hut my finger THAT bad to hold it down...


I also have 0 battery problems.. Once every two days or so I charge it.
 

Velodog2

Member
Silver
Jul 19, 2007
562
0
16
#6
I wasn't that interested in this thread, but I did happen to notice something a couple days ago that is relevant. If you power down the iPhone, then put it in the charging cradle, it will power itself back up. No kidding. I thought that was slightly weird and somehow a little creepy, lol. I also didn't try to repeat it to verify.
 

bigviking

New Member
Bronze
Jul 4, 2007
60
0
0
#7
It is easy to just turn it off, but ...

I agree with the other posters, it is pretty easy to just turn it off before you go to bed. But, I typically want it on until I go to bed, and it's one less thing for me to remember to do.

Just trying to offset my so called "carbon footprint" a little.

Just kidding, it wont make up for the fact that I will always drive a 4x4 SUV.
 

jacjac2

New Member
Bronze
Jul 1, 2007
99
0
0
60
Texas
#8
Last night I had a thought that it would be nice to have my iPhone turn itself off at the same time every night in order to save battery life.

I have written a command line program that can be used to shutdown or reboot your iPhone, and included some instructions that show how to setup the scheduler (cron) to automatically shutdown your iPhone every night.

Anyone that is interested in this can download the software from http://dave.henriksen37.googlepages.com/iPhonesoftware
I have written a program very similar to this....... called one push of button with my finger, lol.... Just had to say it.
 

Tinman

Evangelist
Gold
Jul 16, 2007
4,334
183
63
Aridzona
#9
Folks, enough with the criticism!

Whether you have an interest in this particular functionality or not, you should be happy to see iPhone development.

And look beyond the functionality of this app and you might see how useful being able to control iPhone events via a schedule can be.

In the future this could lead to apps that, say, turn WiFi/BT off at certain hours of the day. Or perhaps change the ringtone at night. Lots of possibilities here.

To the OP: Bravo!


--
Mike
 

Tinman

Evangelist
Gold
Jul 16, 2007
4,334
183
63
Aridzona
#11
Criticism is what makes things evolve. I am not here to talk crap about the program. Just want to emulate the debate, that's it
I have no idea what you mean by "emulate the debate", but criticism like "That's great but can't you just turn off the iPhone yourself?" is merely insulting to the person who wrote this app and no doubt is well aware of how to turn his iPhone off. There is much more going on here than just turning off the iPhone. That's why it is posted in the software forum. It's not like he posted how to turn off the iPhone using its sleep button in the hardware forum.

If this is what the OP can look forward to when posting I wouldn't blame him if he never posted again.

Finally, this little utility can be used right now to "shutdown or reboot" the iPhone. Note the emphasis on "reboot." I tested it and it works. As I like to reboot my iPhone regularly anyway, I am going to automate this nightly (@3 AM). I like this because the iPhone will be on the charger anyway, and when I reboot during the day it destroys the usage stats. And the iPhone is only off for a minute or so, while it reboots.

To the OP: I can get shutdown to work, but I'd like to know exactly which utilities you need from the binkit. I'd rather not install it all. Right now cron is not working right. I did not receive any error when running "launchctl load com.cron.plist" BTW. But I have not been able to get scheduling to work. I modified crontab to this (only wanted a reboot, and my last test was for 1:15 PM):
15 13 * * * root /sbin/shutdown -r


--
Mike
 

bigviking

New Member
Bronze
Jul 4, 2007
60
0
0
#12
Required binutils /setup info

I have no idea what you mean by "emulate the debate", but criticism like "That's great but can't you just turn off the iPhone yourself?" is merely insulting to the person who wrote this app and no doubt is well aware of how to turn his iPhone off. There is much more going on here than just turning off the iPhone. That's why it is posted in the software forum. It's not like he posted how to turn off the iPhone using its sleep button in the hardware forum.

If this is what the OP can look forward to when posting I wouldn't blame him if he never posted again.

Finally, this little utility can be used right now to "shutdown or reboot" the iPhone. Note the emphasis on "reboot." I tested it and it works. As I like to reboot my iPhone regularly anyway, I am going to automate this nightly (@3 AM). I like this because the iPhone will be on the charger anyway, and when I reboot during the day it destroys the usage stats. And the iPhone is only off for a minute or so, while it reboots.

To the OP: I can get shutdown to work, but I'd like to know exactly which utilities you need from the binkit. I'd rather not install it all. Right now cron is not working right. I did not receive any error when running "launchctl load com.cron.plist" BTW. But I have not been able to get scheduling to work. I modified crontab to this (only wanted a reboot, and my last test was for 1:15 PM):
15 13 * * * root /sbin/shutdown -r


--
Mike

The only utilities needed are:

shutdown
cron
crontab

You need to do the launchctl load com.cron.plist to make cron run on reboot. Make sure com.cron.plist is in /System/Library/LaunchDaemons

You also always need to do a "crontab - u root /etc/crontab" whenever you update the /etc/crontab file, followed by restarting cron (which can be done by rebooting the phone).

After editing the crontab file, running the crontab command, and rebooting the phone just login and type ps -aux to verify that the actual cron command is running.

Hope this helps.

I may make an actual gui app that does all the behind the scenes stuff automatically without requiring cron.

Anyway, as some others have said if anyone out there would rather manually shutdown their phone, or recharge it every night, go for it.

Also, all I did was write the shutdown command with reboot and halt capabilities, the other stuff was in the original binutils package.
 

SF_VR6

New Member
Bronze
Jul 1, 2007
62
0
0
#13
I think the time it took for you to write the code will equal to the total time of turning off your iPhone for the life of your iPhone (2 seconds each eveneing) :)
 

machd

New Member
Aug 1, 2007
20
0
0
#15
how exactly does this save battery life? Once charged in the dock, the phone no longer uses the battery hence not counting toward your number of cycles? Isn't this how mac notebooks work too? Is my assumption wrong?
 

bigviking

New Member
Bronze
Jul 4, 2007
60
0
0
#16
how exactly does this save battery life? Once charged in the dock, the phone no longer uses the battery hence not counting toward your number of cycles? Isn't this how mac notebooks work too? Is my assumption wrong?
For the people that just can't understand this, let me make it simple:

If you sleep at night, and don't want to plug your phone in every night, having the phone shut itself off will save battery life when you aren't using the phone, and keeps you from having to remember to shut it off every night.

I now have a working program that automatically grabs some daily radio talk show mp3s, and throws them into my music library via WiFi or Edge.

But, I'm sure nobody would want that when you can just plug your phone into your computer every day to do it right ?
 

machd

New Member
Aug 1, 2007
20
0
0
#17
For the people that just can't understand this, let me make it simple:

If you sleep at night, and don't want to plug your phone in every night, having the phone shut itself off will save battery life when you aren't using the phone, and keeps you from having to remember to shut it off every night.

I now have a working program that automatically grabs some daily radio talk show mp3s, and throws them into my music library via WiFi or Edge.

But, I'm sure nobody would want that when you can just plug your phone into your computer every day to do it right ?
Can you pkease explain how it saves battery life? Compare what you want to do to plugging it in overnight?
 

bigviking

New Member
Bronze
Jul 4, 2007
60
0
0
#18
I can't state it a more simple way than I just did

Can you pkease explain how it saves battery life? Compare what you want to do to plugging it in overnight?
Please carefuly read the above post again. It just can't be said in a more simplistic way than it was above. I think everyone else probably can understand what I said.

Try noggin.com if you need something easier to follow.

And thats all I have to say about that.
 

machd

New Member
Aug 1, 2007
20
0
0
#19
Please carefuly read the above post again. It just can't be said in a more simplistic way than it was above. I think everyone else probably can understand what I said.

Try noggin.com if you need something easier to follow.

And thats all I have to say about that.
i understood. So essentially the only benefits arise wjen you don't want to plug it in. If uou plug it in then there is no benefit? Im just trying to understand.
 

SmartAlx

Zealot
Gold
Jun 7, 2007
1,087
8
38
#20
Folks, enough with the criticism!
With all due rrspect, You are out of line here. The attitude of the thread was positive before you showed up. Sure, people said "of what use is it," but their attitude was light hearted and pretty much ompressed with his ability to wrute a script like this.

Please let's keep the snideness and defensiveness to a minimum y'all.