How to test laptop battery life in your sleep

The most boring task I have as a gadget reviewer is testing battery life. First I tediously configure a phone, tablet or laptop to run a few Internet-connected apps and keep its screen on instead of dimming automatically. (To Android vendors who remove that option from Google’s Settings app: Try tapping a mobile device’s screen every 10 minutes for six hours straight, you jerks.) Then I have to sit there until the gadget in question throws up its hands, electronically speaking, and powers down or enters a last-ditch sleep mode.

But on most laptops, I can stop paying attention once I unplug them. That’s because Windows and Mac OS X each automatically log all system events, including low-battery sleep, and make that data reasonably accessible to the user.

In Windows 7 and 8, open the Control Panel and search for “event log,” then click the “View event logs” link. In that app, click the “Windows Logs” category at the left, then its “System” listing. In a second or two, the center of that window will fill with entries.

Click there, hit Ctrl-F to open a search window, and type “Kernel-Power.” Click the search dialog’s “Find Next” button until you spot an entry whose description reads “The system is entering sleep. Sleep Reason: Battery.” That time is when the battery ran out.

On a Mac, the menu bar will show the last time the computer was on for a few seconds  after you power it on again. After that, the following routine applies.

Hit the Apple-icon menu, select “About This Mac” and, in that About window, click its “More Info…” button; in the next window that opens, click “System Report…” That will open the System Information app (formerly known as Apple System Profiler, also available in the Applications folder’s Utilities sub-folder). In its left-hand column, scroll down to the “Software” heading and select “Logs”; from the list that will present in the app’s top-right pane, select “Power Management logs.”

Click in the the pane below that heading, hit Cmd-F and search for “low power sleep”; you should see an entry including that phrase, preceded by a timestamp and followed by a note in parentheses that the battery was at “Charge:0%”

(I don’t expect many of you will need to employ this knowledge. But at least I won’t have to research this stuff all over again the next time I test a laptop.)

Debugging a few defective defaults in Lion

My review of Mac OS X Lion for Discovery News represented a departure from long-standing practice: For the first time in maybe a decade, I reviewed a new Apple operating-system upgrade by installing it on my primary computer, not an expendable review machine.

As you can read in that writeup, the installation went fine on my late-2009 iMac, and I consider Lion to be a good deal overall. But I also disliked enough of Apple’s changes to prior Mac behavior that I found myself quickly undoing these new defaults–which is another thing I traditionally haven’t had to do with a Mac upgrade. Here are my major corrections:

Tame scrolling and zooming behavior. By default, Lion imposes two iOS aspects on OS X, “reverse scroll” and “smart zoom.” The former has you flicking two fingers in the direction of scroll on a Mac laptop’s trackpad or a Mac desktop’s Magic Mouse, as if either were the screen of an iPad or iPhone–i.e., the opposite of how you’ve scrolled on a computer until now. The latter zooms into a window if you tap two fingers on either input device–which I found myself doing unintentionally way too often. Fundamentally, I think you need a different user-interface grammar on a computer and a touchscreen mobile device. As long as the computer requires you control it through indirect manipulation–that is, by touching something besides the display–the mobile model breaks down. If you agree, you can undo both of Apple’s changes in the Mouse and Trackpad panes of System Preferences.

Show scroll bars. In general, I appreciate Apple’s willingness to edit out complexity and pare things down to the minimum. But hiding scrolls bars until you start to scroll with the mouse or trackpad seems an enormous mistake. In long documents, I felt lost and kept gesturing with the mouse to force the scroll bar to resurface. The effect was even more annoying in Web forms on a page and in other cramped, scrolling-required boxes. And to what benefit–to save a few pixels of screen real estate on the right edge of the window or form? No thanks, Apple. I’ll live with that clutter if it stops me from reflexively twitching a finger on the mouse every few minutes. To undo that mistake, click the button next to “Always” under “Show scroll bars” in the General pane of System Preferences.

Make the Library folder visible again. Apple somehow elected to copy one of Microsoft’s stupider interface decisions by hiding the Library folder in Lion. This is where your applications store their preferences, supporting files and some of their data–and it’s far more human-readable than the tangled array of hidden “AppData” sub-folders in Windows 7 that Microsoft hides from its users. Many common troubleshooting routines require access to your Library’s contents, but Lion hides the entire folder from view. To make it visible again, open the Terminal app and paste in the following command, then hit Enter:

chflags nohidden ~/Library

(That comes from a TidBITS post, but there are other ways to get at this folder. Macworld offers a full 18 workarounds.)

I may adjust more of Lion’s defaults as I get more familiar with this operating-system upgrade. I can also think of other changes I’d make on a laptop–for instance, setting Lion to show a messages when then screen is locked, then maybe adding Boxee to replace the Front Row media-browsing software Apple excised from OS X. But for now, these are the big three fixes I’d make to any Lion installation. What’s on your own list?

Update, 9/7, 4:17 p.m. Since writing this, I’ve had to change two other system settings:

  • To stop getting flicked from the Finder into the Dashboard by an unintended two-finger gesture, I unchecked the “Show Dashboard as a space” checkbox in System Preferences’ Mission Control pane.
  • After twice losing work when my attempt to scroll horizontally led Safari to assume I wanted to go to the previous page–after which this browser failed to return me to the blog post I’d been composing–I unchecked the “Swipe between pages” checkbox under the “More Gestures” heading in System Prefs’ Mouse pane.
About these ads

The market for Mac malware

Are malware makers finally ready to pay Apple the ultimate compliment by writing viruses and trojans that target Mac OS X?

Sure–they already have. For the past few years, Mac trojans have been surfacing that will screw with your machine in various ways. But they all require assistance from the unwise or the unwary: You not only have to download and install one of these malicious programs, you also have to authorize its operation by typing your Mac’s admin password. And these phony applications are so rare and so obvious that Mac users can comfortably get by without running anti-virus software.

That’s not the case in Windows (nor was it always the case with “classic” Mac system software). On Thursday, ZDNet’s Windows columnist Ed Bott suggested that Mac users were due to experience that sort of anxiety, citing the Mac’s increased market share, the history of remote exploits for Mac OS X and the arrival of the first Mac-specific write-your-own-virus toolkit:

My prediction is that the bad guys are still “testing market conditions,” and waiting for the right time for their grand opening. I think we’ll see a few more of these tentative probes—beta tests, if you will—before anyone unleashes a truly widespread attack.

The next day, Bott wrote about a new trojan, hidden behind a “poisoned” image page found in a Google search, that featured both Windows and Mac versions.

The problem with predicting an imminent wave of Mac viruses is that so many people have been wrong before–as Mac blogger John Gruber noted in a post Thursday, titled “Wolf!”, that quoted more than a dozen forecasts of Mac malware doom, going back to 2004. But this time could be different. Veteran Mac journalist Glenn Fleishman surprised a few people, possibly including himself, by repeatedly defending Bott’s analysis in conversations on Twitter.

(This is why you should follow more than one person covering a subject you care about; you’ll see this shop talk among competing reporters and analysts that you’d otherwise miss if you only followed one of those people.)

As a Mac owner and the primary source of tech support for two others (my mom and my mother-in-law), I’m not too worried about Mac trojans. I think Bott slightly oversells that risk, for two reasons.

One, every Mac trojan that I’ve seen so far requires you to type an admin password. Any Mac user with a few weeks of experience should recognize as an unusual sign, reserved only for things like system-software updates and installing printer drivers–other apps only require you to drag their icons to the Applications folder. This sets the Mac apart from Windows, in which almost every single program requires running an installer and authorizing that action by clicking through a User Account Control dialog. That said, recent Windows switchers could easily see a password request from a new OS X app as something normal.

Two, Apple’s Mac App Store provides a safe alternative (though I’m happy it’s not the only way to add third-party software to a Mac.) Somebody worried about getting hit with viruses from strange downloads can stick to that and should be safe. I wish Windows had an equally simple, obvious alternative–a few of my readers at the Post seemed unable to avoid downloading the trojan of the week and desperately needed such an option.

And yet: Over Easter, I expanded my usual troubleshooting of my mom’s iMac by installing the free, open-source ClamXav anti-virus program on that machine.

I’m much more concerned about zero-day exploits of vulnerabilities in OS X’s Internet-facing software. As contests such as the annual Pwn2Own competition have shown, it’s not all that hard to take control of a Mac remotely by luring a victim to a malicious site. The Mac’s growing market share–which Apple put as more than 20 percent of the consumer market in the U.S. back in October–gives malware authors an increasing economic incentive to target those flaws. And Apple’s sometimes-sluggish pace at shipping security fixes makes their job easier.

That’s my worry. I hope I’m wrong about it.