Stable bacterial cross-feeding interactions, where one strain feeds on the waste of the other, are important to understand, as they can be a first step towards bacterial speciation. Their emergence is commonly observed in laboratory experiments using Escherichia coli as a model organism. Yet it is not clear how cross-feeding interactions can resist the invasion of a fitter mutant when the environment contains a single resource since there seems to be a single ecological niche. Here, we used digital organisms to tackle this question, allowing for detailed and fast investigations, and providing a way to disentangle generic evolutionary mechanisms from specificities associated with E. coli. Digital organisms with evolvable genomes and metabolic networks compete for resources in conditions mimicking laboratory evolution experiments. In chemostat simulations, although cross-feeding interactions regularly emerged, selective sweeps regularly purged the population of its diversity. By contrast, batch culture allowed for much more stable cross-feeding interactions, because it includes seasons and thus distinct temporal niches, thereby favoring the adaptive diversification of proto-species.