Although the study of many genes and their protein products is limited by the availability of high‐quality antibodies, this problem could be solved by fusing a tag/reporter to an endogenous gene using a gene‐editing approach. The type II bacterial CRISPR/Cas system has been demonstrated to be an efficient gene‐targeting technology for many insects, including the oriental fruit fly Bactrocera dorsalis. However, knocking in, an important editing method of the CRISPR/Cas9 system, has lagged in its application in insects. Here, we describe a highly efficient homology‐directed genome editing system for B. dorsalis that incorporates coinjection of embryos with Cas9 protein, guide RNA and a short single‐stranded oligodeoxynucleotide donor. This one‐step procedure generates flies carrying V5 tag (42 bp) in the BdorTRH gene. In insects, as in other invertebrates and in vertebrates, the neuronal tryptophan hydroxylase (TRH) gene encodes the rate‐limiting enzyme for serotonin biosynthesis in the central nervous system. Using V5 monoclonal antibody, the distribution of TRH in B. dorsalis at different developmental stages was uncovered. Our results will facilitate the generation of insects carrying precise DNA inserts in endogenous genes and will lay foundation for the investigation of the neural mechanisms underlying the serotonin‐mediated behaviour of B. dorsalis.