Drosophila suzukii (spotted wing drosophila) has become a major invasive insect pest of soft fruits in the America and Europe, causing severe yield losses every year. The female D. suzukii shows the oviposition preference for ripening or ripe fruit by cutting the hard skin with its serrated ovipositor. A recent study reported that mechanosensation is involved in the texture discrimination during egg-laying behaviour in D. suzukii. However, the underlying mechanism and molecular entity that control this behaviour are not known. The transient receptor potential (TRP) channels and degenerin/epithelial sodium channels (DEG/ENaC) are two candidate gene families of mechanically activated ion channels. Thus, we first identified TRP and DEG/ENaC genes in D. suzukii by bioinformatic analysis. Using transcriptome sequencing, we found that many TRP genes were expressed in the ovipositor in both D. suzukii and D. melanogaster, while some DEG/ENaCs showed species-specific expression patterns. Exposure to drugs targeting TRP and DEG/ENaC channels abolished the oviposition preference for harder texture in female D. suzukii. Therefore, mechanosensitive ion channels may play significant roles in the texture assessment of egg-laying behaviour in D. suzukii, which has promising implications to further research on the development of novel control measures.