According to Gizmodo’s report, the iPhone 5s’s accelerometer issues are reputedly due to default calibration errors for the device’s hardware sensors. To combat this, the CEO of indie developer RealityCap, Eagle Jones suggests placing “a calibration procedure into apps” that recalibrates the sensor to receive “a corrected reading.”
Unfortunately, this calibration isn’t perfect: The sensor’s data can still be affected by magnetic and environmental interference (including other phones, tablets, and computers). You can try to fix a badly-behaving accelerometer/compass by force-quitting and relaunching Compass to trigger the calibration screen, and you’ll have the best luck if you calibrate at least several feet away from any other magnetic or electronic devices. But it still may not solve your calibration woes. I ran a few (rather unscientific) tests in my office that equalized my iPhone 5s and 5 within a few degrees, but both iPhone models displayed a header a good 40 degrees south of what it should have.