The fruit flies you’ve seen eating fresh fruit are probably Drosophila suzukii (spotted wing fruit fly). Most (all?) other Drosophila species (including the model organism Drosophila melanogaster) only feed on rotting fruit. Though they’ll consume the sugars too, not just the microorganisms. So standard lab diets include sugar along with yeast and often cornmeal.
There are also some more distantly related flies that feed on fresh fruit and are commonly called fruit flies, eg Ceratitis capitata (Mediterranean fruit fly)
The fruit flies you’ve seen eating fresh fruit are probably Drosophila suzukii (spotted wing fruit fly). Most (all?) other Drosophila species (including the model organism Drosophila melanogaster) only feed on rotting fruit. Though they’ll consume the sugars too, not just the microorganisms. So standard lab diets include sugar along with yeast and often cornmeal.
There are also some more distantly related flies that feed on fresh fruit and are commonly called fruit flies, eg Ceratitis capitata (Mediterranean fruit fly)