The invention discloses an SRAP molecular marker closely linked with male sterility genes of tomatoes and a preparation method thereof. The method comprises the following steps: taking purple-stem fertile tomatoes 87-5 as male parents and green-stem male sterile tomatoes at the seedling stage as female parents, hybridizing to generate F1 generation, and selfing to build an F2 segregation population; performing SRAP marker analysis on male sterility genes ms by adopting a bulked segregant analysis method, randomly combining primers before and after SRAP, selecting 544 pairs of primer combinations, and screening between male sterile and fertile pools to obtain two polymorphic markers C10B9_1 and C10B9_4 between two DNA pools; performing SRAP marker verification on the F2 segregation population by virtue of the two markers, wherein linkage analysis discovers that the linkage distance between the marker C10B9_1 and the sterility genes ms and the linkage distance between the marker C10B9_4 and the sterility genes ms are 3.3cM and -3.3cM respectively. By virtue of the molecular marker, assisted selection of male sterile tomatoes can be performed, the transfer cycle is shortened, the transfer efficiency is improved, a tedious program of identifying the sterility of each generation by selfing in a transfer process is omitted, conventional phenotype selection is transformed into genotype selection, and the accuracy and scientificity of selection are improved.