He said he had never set out to do so, but he feels he has been thrust into the role as virtually every large American company has had to stake out a domestic policy.
He was vocal, for example, in criticizing Mr. Trump after Charlottesville in a memo to his staff: "I disagree with the president and others who believe that there is a moral equivalence between white supremacists and Nazis, and those who oppose them by standing up for human rights. Equating the two runs counter to our ideals as Americans."
Watching Mr. Cook over the years, I've been fascinated to see how he has become as animated when talking about big issues like education and climate change as he is when talking about Apple.
"I think we have a moral responsibility to help grow the economy, to help grow jobs, to contribute to this country and to contribute to the other countries that we do business in," he said.
He added, "I think there's still probably a more significant group that feels my sole responsibility is to Wall Street."
His critics will, of course, say all this happy talk is a P.R. ploy for a company that makes its most popular products on the other side of the world and keeps nearly a quarter-trillion dollars abroad, untaxed by Uncle Sam. In fairness, Apple is one of the largest taxpayers in the country, paying $28 billion in federal taxes between 2014 and 2016 at an average rate of 26 percent, which is in the middle for big multinational American corporations.
And Mr. Cook is paid handsomely: On Thursday, as a result of the company's financial outperformance compared with its peers, Mr. Cook was given nearly $90 million of stock as part of his previously agreed upon compensation plan. (He has said he plans to give away all of his wealth.)
But there's a more nuanced version of Apple's story — and Mr. Cook's transformation of the company after taking over as its chief executive in 2011 — that has been lost amid the din of nonstop chatter about the company in Silicon Valley and Washington.
When Mr. Cook announced, for example, the new data facility in Waukee, he said it would run fully on renewable energy. But he slipped in another fact that has largely gone unnoticed: Over the past several years, Mr. Cook has gotten all of the company's corporate facilities in the United States to run on wind and solar energy — in their entirety.
"We're running Apple a hundred percent on renewable energy today" in the United States, he said over breakfast, "and we've now hit that in 23 other countries around the world."
That's not to say Mr. Cook, 56, is running an altruistic institution. Apple received $208 million in tax breaks from Iowa to locate its data center there. The state has aggressively recruited technology companies, including Facebook and Microsoft, with deep subsidies. A Los Angeles Times columnist criticized the state as a "first-class patsy" for making the deal with Apple, which will create 1,700 construction jobs but only about 50 long-term jobs. Apple agreed to donate "up to $100 million" for local infrastructure, including a youth sports complex, offsetting part of the tax break.
Mr. Cook is most passionate when he talks about education, which led the company to create the curriculum for developing apps, estimated to be a $1.3 trillion part of the global economy.
He is hoping the curriculum turns into jobs. Last year, according to Apple, 150,000 new jobs were created through the App Store. Apple paid out $5 billion directly to app makers.
He said he had chosen to focus on getting the curriculum to community colleges, rather than four-year colleges, because "as it turns out, the community college system is much more diverse than the four-year schools, particularly the four-year schools that are known for comp sci." He noted that "there is a definite diversity issue in tech, in particular in coding and computer scientists."
Apple has already rolled out the curriculum in Alabama, Ohio and Pennsylvania, among other states. "You want it to increase the diversity of people that are in there, both racial diversity, gender diversity, but also geographic diversity," Mr. Cook said. "Right now, the benefits of tech are too lopsided to certain states." (Like California.)
Students who take the classes learn the Swift language, which is used to make apps on Apple's iPhone and iPad. Admittedly, Mr. Cook is not helping students learn how to code in languages for his competitors, but he said, "I think it's significantly transferable."
He continued, with a laugh: "We know that people making a mobile app, many of them are going to make iOS apps and Android apps. And I wish they wouldn't, but they're probably going to."
He added: "It's not like I'm trying to make money on it. It's a gift."
As for Mr. Cook's coding skills? "I might fail a little bit on that."
As we finished up breakfast before we headed over to Austin's Capital Factory, an incubator for tech start-ups where he would announce the new curriculum, I mentioned a question that some in Silicon Valley and elsewhere have asked: Is his focus on jobs and speeches in front of American flags a hint at something bigger? After all, Mark Zuckerberg's name is now regularly bandied about in discussions of potential presidential candidates.
"I have a full-time job," Mr. Cook said. "I appreciate the compliment," he added with a wry look, "if it is a compliment."