Wild species of domesticated crops provide valuable genetic resources for resistance breeding. Prunus davidiana, a wild relative of peach with high heterozygosity and diverse stress tolerance, exhibits high resistance against aphids. However, the highly heterozygous genome of P. davidiana makes determining the underlying factors influencing resistance traits challenging. Here, we present the 501.7 Mb haplotype-resolved genome assembly of P. davidiana. Genomic comparisons of the two haplotypes revealed 18,152 structural variations, 2,699 Pda_hap1-specific and 2,702 Pda_hap2-specific genes, and 1,118 allele-specific expressed genes. Genome composition indicated 4.1% of the P. davidiana genome was non-peach origin, out of which 94.5% was derived from almond. Based on the haplotype genome, the aphid resistance quantitative trait locus (QTL) was mapped at the end of Pda03. From the aphid resistance QTL, PdaWRKY4 was identified as the major dominant gene, with a 9-bp deletion in its promoter of the resistant phenotype. Specifically, PdaWRKY4 regulates aphid resistance by promoting PdaCYP716A1-mediated anti-aphid metabolite betulin biosynthesis. Moreover, we employed a genome design to develop a breeding workflow for rapidly and precisely producing aphid-resistant peaches. In conclusion, this study identifies a novel aphid resistance gene and provides insights into genome design for the development of resistant fruit cultivars.