Because immune defenses are often costly employed, insect immunocompetence cannot be always maintained at its maximum level. Here, the oriental fruit fly, Bactrocera dorsalis (Hendel), was used as a study object to investigate how its immune defenses varied with the developmental stage change and mating access. Our data indicated that both phenoloxidase (PO) activity and antibacterial activity significantly increased from new larvae to pupae but decreased in adults after emergence. Furthermore, both the PO activity and antibacterial activity in the hemolymph of copulated male and female adults were dramatically higher than that of virgin male and female ones, respectively. It provided the evidence that copulation could increase the magnitude of immune defense in hemolymph of B. dorsalis. Together, these results suggest that B. dorsalis possess a flexible investment strategy in immunity to meet its specific needs based on the endo- and exogenous factors, such as their distinct food source and living environments.