Apple CEO Tim Cook makes his way to court after arriving at the United States District Court in Oakland, California to testify in a lawsuit brought by Epic Games, the maker of popular video game Fortnite.

Apple's online marketplace would become a "toxic" mess if the iPhone maker were forced to allow third-party apps without reviewing them, chief executive Tim Cook told a high-stakes trial Friday challenging the company's tight control of its platform.

Cook, the last scheduled witness in the case brought by Fortnite maker Epic Games, offered a robust defense of Apple's procedures for reviewing and approving all the apps it offers for iPhone and iPad users.

"We could no longer make the promise... of privacy, safety and security," without full control of the marketplace, Cook said under questioning from Apple attorney Veronica Moye in federal court in California.

Cook said Apple's review process helps keep out malicious software and other problematic apps, helping create a safe place for consumers.

Without this review, the online marketplace "would become a toxic kind of mess," he said.

"It would also be terrible for the developer, because the developer depends on the store being a safe and trusted place."

Cook's testimony caps a high-profile trial which opened earlier this month in which Apple is accused of abusing a monopoly on its marketplace by creating a "walled garden" that squeezes app makers.

Epic, maker of the popular Fortnite video game, is seeking to force Apple to open up the marketplace to third parties seeking to circumvent Apple's procedures and commissions of up to 30 percent.

Apple booted Fortnite from its App Store last year after Epic dodged revenue sharing with the iPhone maker.

'Not about money'

Under cross-examination, Cook sparred with Epic lawyer Gary Bornstein about the profitability of the App Store.

Cook disputed Epic's contention that its profit margin on apps was some 80 percent, but financial details were not disclosed in court due to confidentiality concerns.

The Apple executive said the proprietary payments system challenged by Epic was about convenience for consumers, more than about profits.

Apple CEO Tim Cook, seen in 2019, defended the company's managing of its App Store, saying the online marketplace could become a "toxic kind of mess" if it were not allowed to review apps.

"We always put the user at the center of everything we do," Cook said. "It has nothing to do with money."

During his testimony, Cook defended Apple's policy of barring apps directing consumers to other platforms to purchase subscriptions or credits for games and other services.

"It would be akin to Best Buy advertising that you can go across the street to the Apple Store to buy an iPhone," he said.

But District Court Judge Yvonne Gonzalez Rogers, in a series of harsh questions for Cook at the end of his testimony, suggested that Apple's cut is too high even if reduced to 15 percent after the first year.

"It does appear to be disproportionate," the judge told Cook. "After that first interaction.. the developer is keeping those customers, Apple is just profiting from them."

Cook retorted quickly, "I see it differently," and then added: "We are creating the entire amount of commerce on the store and we are doing that by getting the largest audience there."

Apple does not allow users of its popular devices to download apps from anywhere but its App Store, and developers have to use Apple's payment system, which takes its cut.

The Epic lawyer also questioned Cook about Apple's arrangement with Google to be the default search engine for the iPhone maker's Safari browser, another area scrutinized by antitrust officials.

Cook acknowledged that Google pays for this position but added that Apple made the arrangement "in the best interest of the user."

The case in Oakland comes with Apple feeling pressure from a wide range of app makers over its control of the App Store, which critics say represents monopolistic behavior.

The European Union has formally accused Apple of unfairly squeezing out music streaming rivals based on a complaint brought by Sweden-based Spotify and others, which claim the California group sets rules that favor its own Apple Music.

A recently formed Coalition for App Fairness, which includes both Spotify and Epic, have called for Apple to open up its marketplace, claiming its commission is a "tax" on rivals.

Closing arguments in the bench trial in California were expected early next week, with the judge expected to rule within several weeks.