Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

We have multiple users that are assigned MacBook Pro's who we know never take them away from their desks. We need some sort of proof to repurpose this hardware and issue them an iMac. We would really like a terminal command we can send or a script we could run to determine the last time the laptop was unplugged.

So far everything we've found just tells you its current state, but not "timer"?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

You might be able to use ioreg to determine the cycle count of the battery. A low cycle count indicates that the battery has not been discharged and charged very much.

ioreg -l | grep Capacity

"Cycle Count" shows how many times the battery has been cycled. You can read more about battery cycle counts here.

Another idea is to use pmset to log the state of the system's power. You could, in theory, have that dump to a file to investigate after some time has passed.

Take a look at the man page for pmset.

pmset -g pslog will log the state of system's power. As the device is unplugged or plugged you'll see the log update. This could show how frequently a notebook is unplugged and charged. If it remains plugged in for long spans of time, or is often drawing from 'AC Power' then you'd know if it's mobile or not.

share|improve this answer
    
Thank you! I knew the ioreg command, but haven't seen the pmset one. We'll give that a shot! –  Rosko Jan 10 '13 at 17:32
add comment

I'll third the suggestion of pmset's logs, however an easier way to access that log (tested under 10.8) is to open System Information, go down to the Software section, pick the Logs subsection and you should see "Power Management logs". Hope this helps!

share|improve this answer
add comment

pmset -g rawlog

will show battery details

share|improve this answer
    
Welcome to Stack Exchange! Can you please expand on what kind of details that command shows? –  Kevin Chen Jan 17 '13 at 2:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.