For the lone farmer who's just trying to make it through the season and can't afford an accountant, it may seem difficult to correctly account for costs, but if you're one of the richest large multi-national corporations in the world, you'd book the revenue according to GAAP and not try to guess at how to do it from first principles. In particular, you'd pick a method and stay with that until there's a reason to change. By "percentage of revenue contribution" is entirely valid, though there are other methods.
Since the question was written to pose by percentage of revenue contribution as wrong, by production units is another way you could do it. But importantly, as a public company, you pick a method and go with that so that the numbers can be compared from year to year, and quarter to quarter, and is more important than the absolute number, though that's still important.
Importantly, it's not this big crazy unknown question that's never been answered before in the history of the business of sheep. Or hardware and software sales. Apple, whos legal and accounting department used an aggressive tax minimization strategy similar to the Dutch Sandwich to book revenue in Europe until they got called out for it, isn't comprised of "hick farmers" who don't know what they're doing and can't figure out a method on how to book revenue. It's a ploy yet again to avoid paying taxes or developers and isn't some off-the-cuff answer.
Apple, as a public company, is required to break out material revenue, and thus the App store revenue is listed in their quarterly 10-K with the SEC. Cost of sales and operating expenses are also listed. Importantly though, the lawyers fighting Apple just need to establish that the percentage is quite high, even if a specific number came be agreed upon, and thus Apple is can sustainability pay out whatever they're being asked for.
Though, the SEC is a US institution and has limited reach outside of the US, and the linked case is coming from the UK,
so I'm not sure if the existence of the 10-K comes into play.