My vocabulary trainer stands "to live on" and my vocabulary trainer says that it means that somebody does something to make one's living (by doing something).
Example: I live on selling cars.
But I have also learned that "to live by" means exactly the same (and I have often heard sentences like "I'm living by selling cars").
Well, my question is: When should I use "to live by" and when "to live on"? Or is one of these prepositions wrong?