Should he become Taiwan’s president, he will have to strike that balance on an even bigger scale. Mr. Gou has said Taiwan must tread carefully to avoid being trampled in the trade dispute between Beijing and Washington, especially as the United States has stepped up its support for Taiwan as a counterweight to China’s growing dominance in the region.

“If we are too optimistic and biased toward either side,” Mr. Gou wrote in a recent Facebook post, “it will push Taiwan to an unpredictable danger.”

What has been good for business might not be good for Mr. Gou’s political prospects in Taiwan, which is wary of China’s influence. Mr. Gou has cultivated good ties with Communist leaders for decades and has met Xi Jinping, China’s leader, several times. His business’s dependence on China is seen as offering Beijing leverage over him. Critics have questioned whether he would put Taiwan’s interests first when handling cross-strait matters.

Mr. Gou has moved to try to address those concerns. In addition to handing over management of the company, he has suggested that Foxconn could move some of its production lines from the Chinese cities of Tianjin and Shenzhen to the city of Kaohsiung in southern Taiwan.