But it soon might be in the cross hairs of President Trump. Apple, one of the quintessential American brands, assembles most of its products in China — and Mr. Trump has noticed. He criticized Apple on the campaign trail, saying he’d force it to start making its products closer to home. While president, he has said Apple plans “to build a lot of plants” in the United States — even though it hasn’t announced plans to do so. (Mr. Cook hasn’t publicly corrected him.)

While Apple avoided an iPhone tax in the first rounds of tariffs, it might not be so lucky if Mr. Trump is looking for more products to target. If that happens, Apple will be in a pickle. Its supply chain is entrenched in China, and finding another country that can match China’s scale and skill in the labor market will be difficult. The iPhone is also already among the world’s most expensive phones. Increasing the price to pay for tariffs would most likely scare away even more buyers.

Cozying up to the president to spare Apple products from tariffs also risks angering Apple’s employees in liberal Silicon Valley — even some of its customers. So far, Mr. Cook has walked a fine line, holding cordial private meetings with Mr. Trump while also publicly criticizing his policies, without drawing the ire of the president or Apple employees.

On Friday, speaking to reporters at the White House Rose Garden, Mr. Trump reiterated that he wanted Apple to move manufacturing to the United States.

“Don’t forget this: Apple makes their product in China,” he said. “I told Tim Cook, who is a friend of mine and who I like a lot: ‘Make your product in the United States. Build those big, beautiful plants that go on for miles, it seems. Build those plants in the United States.’”

He went on to say China, not the United States, gets the biggest benefit from Apple. “They build their product mostly in China.”