Apple boss Tim Cook took the witness stand for the first time in his company's major legal battle with Epic Games over an alleged monopoly.
Epic, maker of the hit video game Fortnite, claims Apple's tight control over iPhone apps hurts competition.
During his appearance, Mr Cook argued that keeping control of the App Store helped keep iPhones secure.
He also said he did not know if the App Store made a profit, telling the court Apple did not break down the figures.
Facing questions about the level of profit the App Store generates from the 30% commission it takes on sales, he said: "We don't have a separate profit and loss statement for the App Store."
Instead, he said that he had a "feeling" that it was profitable - but could not share figures with the court.
Mr Cook was being questioned about his oversight of top-level decisions around the App Store's policies.
Judge Yvonne Gonzalez Rogers also questioned Mr Cook, asking about a survey that showed 39% of developers are dissatisfied with the app store.
Mr Cook said he was not familiar with the survey but said there was a "friction" because Apple rejected 40% of apps weekly.
The judge also asked him if he was a gamer, to which he admitted that he was not.
Mr Cook's opposite number in the case - Epic Games chief Tim Sweeney - has already appeared on the stand in the opening days of the long-running legal battle.
Two main things are at the center of the case: the 30% commission Apple takes on in-app purchases, and the fact that no other app stores are allowed to exist on the iPhone and iPad to offer an alternative.
Epic's Fortnite is one of the most popular games in the world and makes its money through in-game purchases of character costumes and other digital items.
A 30% cut on millions of such purchases adds up to a lot - but Apple's rules forbid the company from circumventing its payment methods if a sale is made in the iPhone app.
In August last year, Fortnite offered players a 20% discount if they paid Epic Games directly, in direct violation of Apple's rules.
Apple quickly removed the app from its store - as did Google, which enforces a similar policy.
Epic had clearly expected that to happen. The firm immediately launched a PR blitz to mobilize its fanbase and win support, painting Apple as a dominating force suppressing freedom of choice.
Within hours, Epic lodged prepared legal complaints in the US against both Apple and Google.
But the debate goes beyond the 30% cut, to wider questions about competitiveness. Epic has made no secret of the fact that it would like to run its own app stores on both iOS and Android, avoiding Apple's and Google's payment and delivery systems entirely.