The latest of these — and perhaps the most grating to the Chinese — was a naval maneuver in which an American guided-missile destroyer sailed near disputed territory claimed by Beijing in the South China Sea. The movement by the warship, the Stethem, off Triton Island in the Paracel archipelago prompted a furious response from China’s government, which called it a “serious political and military provocation.”

Still, neither leader appeared ready to abandon the rapport that Mr. Trump and Mr. Xi established in April at a summit meeting in Palm Beach, Fla. Mr. Trump avoided any personal jabs at Mr. Xi; the Chinese government said tensions were to be expected in a relationship this complex. But each leader has learned a hard lesson about the other, according to officials and outside analysts.

Mr. Xi, they said, miscalculated what China needed to do to satisfy Mr. Trump, thinking he could buy him off with a few highly visible measures, like banning coal purchases from the North. Mr. Trump overvalued the personal touch by betting that a few hearty handshakes with Mr. Xi would overcome China’s deep-rooted resistance to pressuring North Korea.

“The Chinese tried to figure out what was the absolute minimum they needed to do,” said Bonnie S. Glaser, director of the China Power Project at the Center for Strategic and International Studies. “The administration has signaled repeatedly that they had to shut down these banks and front companies in northeast China that enable North Korea.”

Chinese officials professed surprise last week when the White House rolled out three tough steps, back to back. It imposed sanctions on a Chinese bank, accusing it of acting as a conduit for illicit North Korean financial activity, as well as on a Chinese company and two Chinese citizens.

It approved the sale of $1.4 billion in weapons to Taiwan, which China regards as a breakaway province. And it labeled China one of the worst offenders in an annual State Department report on human trafficking.

The White House also signaled it would act against imported Chinese steel as part of a broader campaign against steel dumping around the world. But the Commerce Department’s report on the steel market, which would be the basis for tariffs and other sanctions, is still undergoing revisions and will not be released before the Group of 20 meeting.