There are a number of ways, one is setting the design resolution - see this tutorial :
The way I like to do it is to make 3 sets of artwork, using 960 x 640 as a "base". One set is for the base, one for 2x base and one 0.5x base.
Then on appstartup, I have a GameManager singleton class, and that takes the visible size from the CCDirector.
Depending on the size, I set a file suffix for which graphic set I want to use, and I also set various parameters, such as scaleX, scaleY, offsetX, offsetY.
All this is initialised on startup.
Then when initialising items on the screen, their initial scalefactors are set using ScaleX and ScaleY, and their positions using ScaleX*x + OffsetX,ScaleY*y + OffsetY.
I did this when porting an iPhone game, and it worked fine.
The really good thing, as the post above points out, is that cocos2d-x has windows & mac projects where you can set the resolution in the app-controlller which makes it quick to test different screens.