> In which world is "iOS apps" an industry?

The one where the set of customers is almost completely disjoint.

> To what degree? Should the user be able to swap out the kernel code? Should they be able to switch out the phone CPU?

The vendor should take no measures to prevent the device owner from doing these things.

> And in doing so, you compromise the security of your product.

Products should not be "secure" against their owners. You need not concern yourself with the experience of people who willingly choose to take matters into their own hands.

> This is why I phrased it as a thought experiment and not a reality. You are sidestepping the question.

I answered the question. You should not take any measures to impair the owner from doing as they please. You don't have to make it easier, just don't actively make it difficult or take steps to purposely impair competition.

> Just about zero storefronts have commissions that even remotely align with business costs. Walmart's 12-17% commission is far in excess of the operating costs.

Competitive businesses have margins that align with business risk and the cost of required capital, because that's what competitive means -- it means that somebody else exists who is reasonably able to take your customers by undercutting your price as long as doing so is still profitable enough to exceed their own capital costs.

> So is the Play Store's 30%, or Amazon's own commission.

Google Play has a weaker app monopoly than Apple because their mechanism is different -- OS APIs that require Google apps, which in turn require Google Play and cause it to be the default app store on nearly all Android devices. But it's not as if that's the canonical example of a competitive market either. And then you look at some of the competitors they do have, like F-Droid, which operates with zero margin at all.

> How? Moving from Android to iOS or the other way is trivial. It is not nearly like moving from state to state. You either buy an iPhone with an App Store, or an Android phone with something else. There is no artificial lock-in besides your own wallet.

You can't be serious. Once you have one device or the other, your data ends up on that vendor's services in those data formats, the builtin apps are different and you become accustomed to them and incur retraining and data transfer expenses, both platforms don't have exactly the same apps so if you use an app which is only on one platform then you have to use that platform and are locked into that app store for all other apps, once you've paid hundreds of dollars for a phone the resale value drops immediately and switching would require eating the loss which can be more than $100 compared to an app cost of only $1. You may prefer one platform over the other for any number of reasons having nothing to do with the app store but those reasons discourage you from switching and thereby tie you to the app store of that platform.

Its exactly like moving from state to state. The numbers aren't as big because a phone doesn't cost as much as a house, but they're the same relative to the cost of apps when an app costs around $1 compared to the typical trip to a grocery store of several hundred dollars, and have the same kind of switching costs where you have to move all your stuff and make labor-intensive changes to many other things that are independent of the app but not the location/platform.