Simple SummaryBactrocera dorsalis (Hendel) is a widespread and economically important insect pest, infesting various fruits and vegetables. Due to the instability of climate change in early spring and autumn, extreme cold and hot temperatures were developed in a short period of time. Exposure to sudden short-term high or low temperatures may affect the reproduction, development, and physiological changes of B. dorsalis. In this study, we determined the effects of short-term temperature treatments on the growth, development, fecundity, and trehalose metabolism of B. dorsalis. The results showed that development and reproduction of the flies were negatively affected when temperature was below 10 °C; or more than 31 °C, even causing permanent sterility at extreme temperatures. The changes of glucose, glycogen, trehalose, and trehalose-6-phosphate synthase level had a correlation with the population dynamics of the fruit flies. Our present study can provide a scientific basis for population monitoring, prediction, and comprehensive prevention of the fruit fly.An understanding of physiological damage and population development caused by uncomfortable temperature plays an important role in pest control. In order to clarify the adaptability of different temperatures and physiological response mechanism of B. dorsalis, we focused on the adaptation ability of this pest to environmental stress from physiological and ecological viewpoints. In this study, we explored the relationship between population parameters and glucose, glycogen, trehalose, and trehalose-6-phosphate synthase responses to high and low temperatures. Compared with the control group, temperature stress delayed the development duration of all stages, and the survival rates and longevity decreased gradually as temperature decreased to 0 °C and increased to 36 °C. Furthermore, with low temperature decrease from 10 °C to 0 °C, the average fecundity per female increased at 10 °C but decreased later. Reproduction of the species was negatively affected during high-temperature stresses, reaching the lowest value at 36 °C. In addition to significantly affecting biological characteristics, temperature stress influenced physiological changes of B. dorsalis in cold and heat tolerance. When temperature deviated significantly from the norm, the levels of substances associated with temperature resistance were altered: glucose, trehalose, and TPS levels increased, but glycogen levels decreased. These results suggest that temperature stresses exert a detrimental effect on the populations’ survival, but the metabolism of trehalose and glycogen may enhance the pest’s temperature resistance.