His note gushed about being at “truly a model school” that used a curriculum promoted by Apple. Local media reports noted that Cook seemed “in a very good mood” — perhaps with some surprise.

After all, these are trying times to be an American company operating in China, let alone an American tech giant that counts on China for contract manufacturing and sales.

AD

Although Apple largely dodged the tariffs President Trump imposed on Chinese imports last month, it is still caught in the middle of the increasingly acrimonious trade war.

AD

Trump has suggested that the company should shift its assembly to the United States. “Start building new plants now,” he tweeted last month.

But it is not so simple.

“For many American tech companies, [Chinese President] Xi Jinping is more important than Donald Trump because China is often their largest and fastest-growing market,” said James McGregor, chairman of the greater China region for APCO Worldwide, a business consultancy.

Apple accounted for about one-quarter of cellphone sales in China last year, and analysts say the country is on course to overtake the United States as Apple’s biggest market.

AD

The Chinese government has repeatedly, and not very subtly, suggested that American corporate leaders such as Cook should help broker a solution to the trade war by talking sense to Washington.

AD

“These guys are caught in the middle and it’s awkward,” McGregor said.

With tariffs affecting both countries, China is digging in its heels.

Its commerce minister said this week that Beijing will not yield to U.S. demands even if Trump puts more tariffs on its products — as he has threatened.

“There is a view in the U.S. that so long as the U.S. keeps increasing tariffs, China will back down. They don’t know the history and culture of China,” Zhong Shan said in a statement sent to Bloomberg News.

AD

“This unyielding nation suffered foreign bullying for many times in history,” he said, “but never succumbed to it even in the most difficult conditions.”

Trump has upped the ante this week by suggesting that China owes its development to the United States. “We helped rebuild China,” he said Tuesday. “If we don’t do that, China’s not where they are right now.”

AD

Then there is a recent Bloomberg News report that tech companies including Apple and Amazon.com found Chinese surveillance chips in their Chinese-made servers. Both companies have strongly denied the report. (Amazon founder and chief executive Jeffrey P. Bezos owns The Washington Post.)

Into the middle of this comes Cook.

AD

He regularly visits China to deal with the tech giant’s business here or in his capacity on the board at Tsinghua University School of Economics and Management. Apple is also building a joint research center with Tsinghua that will focus on advanced technologies, including machine learning and computer vision.

This week, he has been on a one-man charm offensive to promote Apple products, including the new iPhone XS Max, which sells for a whopping $1,850 in China. A top-end phone by local manufacturer Huawei retails for about $700. As such, sales of the new Apple phone have been disappointing, the business publication Caixin reported after interviewing authorized retailers.

AD

Cook dropped in on people practicing yoga while wearing Apple Watches and an exhibition of photos taken on iPhones. On Weibo, he posted photos taken with his own XS Max.

AD

“Hello again . . . Shanghai changes with every passing day!” he wrote on Weibo, along with a waving emoji and a photo of the city’s spectacular riverfront. He then used a four-character idiom that literally means “all rivers run into the sea” but conveys the sense that one should be open-minded and tolerant.

Cook is expected to attend a board meeting at Tsinghua while in Beijing. But an Apple spokeswoman declined to comment on whether he will meet with the Chinese president — as he did during his visit this time last year. She also declined to divulge what else was on his schedule or how long he will be in China.

Regardless, Cook’s top priority this week is remaining in China’s good books.

“Tim Cook has got to cozy up to the local customers, but more importantly, to local officials,” said Bryan Ma, a technology analyst at IDC, an international market research firm. “Part of the messaging that he is probably hoping to establish while he is here is to emphasize how important China is to his company.”

AD

AD

That message was received loud and clear in Shanghai.

“We are willing to . . . find mutual benefit and win-win results, and to inject new vitality into Shanghai’s development,” Li Qian, secretary of the Communist Party in Shanghai, said after meeting with Cook. But he made it clear that Apple must do its part on bilateral relations.

“We are hoping that Apple will play a bigger role in promoting exchanges and cooperation between Shanghai and the United States,” Li said, according to a statement from his office.

But not everything has gone completely smoothly for Cook.

Chinese social media users had a laugh — more with him than at him — when photos showed Cook trying to use Apple Pay on his Apple Watch to board a ferry to get to an Apple store on the other side of the river.

AD

He tapped the watch in the wrong place and went through the turnstile meant for bikes. Some netizens seemed concerned that Cook might be having a bad week. One user called Linghushaoxiamen wrote to him: “Are you ok?”

