A whole pretuning system was established and automatic measuring of the copper model of a 1.3 GHz 9-cell superconducting cavity was realized based on the commonly used theory of the tuning of multicell cavity’s field flatness. For the bead pull measurement of the field profile, a Labview program was written to acquire data and control the step motor cooperatively. A Java program was written to calculate the frequency correction of each cell by a series of matrix manipulation of the field profile data. Then one of the 9 cells was squeezed or stretched according to the estimated frequency correction. With the procedure repeated for several times, the multicell cavity was tuned to the design frequency and field flatness with good accuracy.