Problem with Box2d in portrait orientation mode on iPhone

Hey, maybe my question is stupid, but I ask you. When I start a new project from the template and sets the orientation to portrait mode in simulator it works fine. But when I try to do it on the iPhone gravity turn left.

I set portrait mode by modifying GameConfig.h
#define GAME_AUTOROTATION kGameAutorotationCCDirector

and App delegate file
//#if GAME_AUTOROTATION == kGameAutorotationUIViewController
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
//#else
// [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
//#endif
What I do wrong?
I am using last version cocos2d 0.99.5 rc0

The problem is with accelerometer function. But I need body reaction for device rotation so I cant disable accelerometer function.

Please help to solve the problem.
Sorry but I think you're asking in the wrong place. This is a cocos2d question, there must be somewhere you can questions like this.

Original thread: https://box2d.org/forum/viewtopic.php?t=5834