For future reference and people who find this through the search dialog, I'll add some sneaky tricks for other games:
Diamond / Pearl
These 2 games contain the Tweaking glitch, which lets you enter the "Void", which is the black area outside of the visible map (parts of that area can be seen when you're standing close to a wall in a building). In this area, since there are few colliders, you can walk/run/bike indefinitely (actually, around 65000 steps before you run into something, but yeah...) as long as you find a clear path (which exist in great numbers). Numerous resources on the Internet explain how Tweaking works and what paths exist (although most are related to reaching Darkrai or Shaymin).
Note that this bears the risk of your game freezing when you Egg hatches in an area that would make it freeze if you saved, so it might not always work and you might need to find different paths for each number of steps.
To run indefinitely without actually pressing the D-Pad all the time, just put something heavy (like a can or some heavy tool) on it that locks it in position. Some sort of clip or tape might also work.
If you're using a 3DS, you can use a small coin to lock the joystick in any direction. This also applies to the Gen 6 trick.
X / Y
In Lumiose City, the Plaza outside the Prism Tower is round and contains a clear path all around. Just go there and lock the joystick as described above. Talonflame is a great Pokemon for hatching as it has Flame Body and can learn Fly (to get to the Central Plaza faster).
Also, don't forget to use the Hatching O-Power to speed the process up even more.
This is just pointing out the obvious (and is implicit to Willihams answer), but you should always ride your bike while hatching. This increases the rate of steps vs. actual time spent.