CARY – Apple CEO Tim Cook described the company’s ironclad control over its mobile app store as a way to keep things simple for customers while protecting them against security threats and privacy intrusions during Friday testimony denying allegations he has been running an illegal monopoly.

Third-parties “are not as motivated” as Apple maker to protect users against malicious malware, Cook told a judge Friday in Oakland, California, according to Bloomberg news.

“For us, the customer is everything. We’re trying to give the customer an integrated solution of hardware, software and services,” he added.

The trial is nearing its close after three weeks of testimony.

“I think it’s important to know sometimes there’s a conflict between what the developer may want and what the user may want,” Bloomberg quoted Cook as saying.

Cook also said allowing of third-party app marketplaces would be “terrible,” Bloomberg added.

“It would be a huge convenience issue, but also the fraud issues would go up” because customers would have to enter credit-card information multiple times, Cook testified Friday in Oakland, California, as a three-week trial winds toward its close.

The rare courtroom appearance by one of the world’s best-known executives came during the closing phase of a three-week trial revolving an antitrust case brought by Cary-based Epic Games, maker of the popular video game Fortnite.

Epic Games vs Apple: The Super Bowl of court cases – here’s why the lawsuit is so important

Epic is trying to topple the so-called “walled garden” for iPhone and iPad apps that welcomes users and developers while locking out competition. Created by Apple co-founder Steve Jobs a year after the iPhone’s 2007 debut, the App Store has become a key revenue source for Apple, a money-making machine that helped power the company to a $57 billion profit in its last fiscal year.

Epic is trying to prove that the store has morphed into a price-gouging vehicle that not only reaps a 15% to 30% commission from in-app transactions, but blocks apps from offering other payment alternatives. That extends to just showing a link that would open a web page offering commission-free ways to pay for subscriptions, in-game items and the like.

Guided by friendly questioning from an Apple lawyer, Cook’s testimony often sounded like a commercial for the iPhone and other products that he hailed as the best in the world. The tone was not coincidental. Besides counting on Cook to help win the case against Epic, Apple viewed his closely watched courtroom appearance as an opportunity to tell its story while the app store is also under scrutiny by lawmakers and regulators in the U.S. and Europe.

Cook said Apple’s commitment to customers includes ensuring technology remains “simple, not complex” for users of Apple products, Cook said, and protecting their privacy, which he called “one of the most important issues of the century.”

“I think it’s important to know sometimes there’s a conflict between what the developer may want and what the user may want,” he said, Bloomber reported.

Cook is expected to face a much more daunting challenge later Friday when Epic lawyer Gary Bornstein gets a chance to grill him. That sparring could take about two hours and will likely to delve into the strategies Cook has drawn up since taking the CEO job nearly a decade ago, just a few months before Jobs died of cancer in October 2011.

Apple fiercely defends the commissions as a fair way for app makers to help pay for innovations and security controls achieve those goals while also providing benefits for app developers, including Epic. Apple says it has invested more than $100 billion in such features.

It also argues that App Store commissions mirror fees charged by major video game consoles — Sony’s PlayStation, Microsoft’s Xbox and Nintendo’s Switch — as well as a similar app store run by Google for more than 3 billion mobile Android devices. That is roughly twice the number of active iPhones, iPads and iPods that rely on Apple’s store for apps.

The App Store ranks among Apple’s biggest successes during Cook’s reign. Since beginning with just 500 apps in 2008 the store has ballooned to 1.8 million apps, most of which are free. Apple has drawn upon its commissions and exclusive in-app payment system to help more than double the annual revenue of its services division from $24 billion in fiscal 2016 to $54 billion last year.

“I think it has been an economic miracle,” Cook boasted Friday.

This boom wasn’t something Jobs foresaw. Shortly after the store opened, Jobs publicly said Apple didn’t expect the App Store to be very lucrative. Epic’s lawyers have repeatedly cited those comments as evidence that Apple reshaped the store to fuel its earnings growth once the popularity of mobile apps became clear.

Exactly how profitable the App Store is has been a point of contention throughout the trial. An accounting expert hired by Epic estimated that its profit margins range from 70% to 80%, based on a review of confidential Apple documents. But Apple has insisted those numbers aren’t accurate because they don’t reflect expenses spread throughout the company’s operations.

Phil Schiller, a longtime Apple executive and former Jobs confidant, conceded earlier this week that the company’s commission system had generated more than $20 billion in revenue through June 2017. Epic lawyer Katherine Forrest had presented him with that estimate, based on numbers that Apple publicly released in mid-2017.

Cook also acknowledged the App Store is profitable but said he didn’t have a concrete number. “I have a feel, if you will,” he testified.