Firstly ; where do they come from : (yes, I know, It’s the fruit, stupid!) but if you have a little google at the life cycle of the Drysophila melanogaster : first there are eggs, then three stages of actual maggot until fly pupae one and two. Honestly, my cleaning standards may fall short of five star, but I really do think I would notice if I was actually eating fruit with maggots on!
I have been experimenting with a home made trap : it’s a glass of home made ginger beer that I got tired of swatting them away from, and then let them have. At the beginning I thought I had a few fruit flies : maybe six or seven at the most : but the trap has been there for about 24 hours now, and there must be at least 30 in there and a few of the more intelligent ones are still licking ginger beer off the glass without falling in (should I catch these elite specimens for genetic experiments, I wonder? Hang on though, if we all end up as the human slaves of a new race of super-intelligent superflies, it would all be my fault. Better not, eh?) Are they breeding on the glass? (come to think of it, I have noticed some of them doing the fly-nasty on the glass rim…)
Anyway, to get rid of them, if you aren’t using them for genetics reasons, and if, for some reason, the suggested wikiHow approach of ‘keep your house clinically clean with all organic matter strictly controlled and preferably sealed in a refrigeration unit’ doesn’t appeal, the most entertaining, and least demanding way I’ve found, is to leave old cider bottles around, with a bit left in the bottom, and hope that we aren’t just giving them the opportunity to mutate into swimmers.
Oh, and wash your fruit before eating it!