A fault line may send out tiny shocks, called foreshocks, days or even weeks before a major earthquake. When a fault line is about to rupture and cause an earthquake, the types of waves it sends out change.
Rupturing faults send out two different types of waves: P-waves and S-waves. The P-waves move faster, but the S-waves are the ones that cause the heavy damage -- along with the waves that move along the Earth's surface. Faults do not send out waves continuously, but once the rupture begins, earthquake sensors can pick up on incoming waves, and alert center staff have time to provide detailed warnings about the coming earthquakes.
The sensors are embedded in the ground, and when the P-waves hit, alert signals go to the center. While these systems provide only minutes or seconds of warning time, often that is enough to allow for the evacuation of major buildings if the quake is a major one. People living in earthquake-sensitive areas often have apps on their phones designed to receive these alerts, so they can prepare for the intensity of the earthquake at their location.
An earthquake early warning system called ShakeAlert was tested in California in January of 2012. ShakeAlert is able to transmit messages almost instantaneously, and may be able to save lives.