This summer we had an infestation of fruit flies. Now that it's under control, I thought I'd share what we did:
1) Clean everything. Sponges, walls, utensils, appliances. Warm, soapy water will wash off eggs, pheromones, and leave a soap film that they hate. And anything they hate, I love.
2) Spritz them out of the air with Rubbing Alcohol. I'm actually not sure if alcohol kills them. But when they are flying around (in groups - shudder), it is satisfying to spray them and see them drop out of the air like lead balloons.
3) Trap them. For years we've used the standard cider vinegar in a glass with a drop of detergent. The detergent destroys the surface tension, so when the flies alight to drink the alluring liquid, it's the fruit fly equivalent of quick sand. An open bottle or bowl is ok. Using a paper funnel to aid entrance and impede exit is better.
This year we got a bit more sophisticated. We stuck a drinking straw through a capped plastic bottle. There's an exit cut into the straw, so the flies can get from the straw to the liquid. I also mixed wine vinegar with the cider vinegar, which seems to have attracted more flies than the traps that only had cider vinegar.
4) Vacuum them up. This last technique works best with individual flies on a flat surface. Turn on the vacuum in the center of the room. Carefully lay the nozzle along the wall at least 2 inches from the fly. Edge the nozzle towards the fly - by the time it tries to take off, it'll likely get sucked straight into the vacuum.
You can try to vacuum them out of the air, but don't expect to succeed.
5) Squish them. Once you've calibrated your fruit flies, you can sometimes simply squish them. Slowly place your squishing implement (e.g., hand) 1-2 inches away, or whatever you've determined is the 'comfort zone' for your flies. Then BAM. If you have a fine mesh fly swatter, that's good. I've also had good success with a crumpled plastic bag (increases effective surface area and breaks up the rush of air on which they typically escape).
Lastly, make sure you and yours clean up promptly and thoroughly after all interactions with food.
[I've seen theoretical discussions of using a homemade fly paper made from nori and molassas, so the resulting molassas/seaweed/dead fly thing can be fed to fish. If anyone tests that hypothesis and finds it actually eliminates an infestation, that would be good to know.]