Insects that feed on various host plants possess diverse xenobiotic adaptations; however, the underlying mechanisms are poorly understood. In the present study, we used Grapholita molesta, which shifts feeding sites from peach shoots to apple fruits, as a model to explore the effects of shifts in host plant diet on the profiles of cytochrome P450s and the gut bacteria microbiome, as well as their effects on biopesticide adaptation. We found that the sensitivity of the fruit-feeding G. molesta to emamectin benzoate biopesticide was significantly lower than that of the shoot-feeding larvae. We also found that the P450 enzyme activity and the expression of nine cytochrome P450s were enhanced in G. molesta fed on Fuji apples compared to those fed on peach shoots. The survival rates of G. molesta exposed to emamectin benzoate significantly decreased as each of three of four emamectin benzoate-inducted cytochrome P450 genes were silenced. Furthermore, we discovered the gut bacteria dynamics of G. molesta changed with the host shift and the structure of the gut bacteria microbiome was determined by the final diet ingested; additionally, the dysbiosis of the gut microbiota induced by antibiotics could significantly increase the sensitivity to emamectin benzoate. Taken together, our results suggest that the expression of P450s and the composition of the gut bacteria microbiome promote adaptation to emamectin benzoate in G. molesta, providing new insights into the molecular mechanisms underlying xenobiotic adaptation in this notorious pest.