On a steamy summer morning, dozens of buses pull up outside a cluster of low-slung, blue buildings in

. Women dressed in colorful salwar kameezes disembark, their dupatta body scarves billowing as they make their way past hibiscus bushes and posters proclaiming, “Our aim, no accident.”

The night shift at

Technology Group’s mobile phone plant in Sri City is ending, and thousands of young women are punching out as others stream in to replace them. One of the arrivals is Jennifer Jayadas, a tall, slim 21-year-old who lives several miles away in a two-room hut with no running water.

After gobbling down a free breakfast of chapatti flatbreads with a potato-and-pea curry, she dons a checked white hat, apron-shirt, static-resistant footwear and tiny finger gloves. Then Jayadas takes her place at a testing station where she will spend the next eight hours making sure the volume, vibration and other phone features work properly. “Smartphones used to be all made in China,” she says. “Now, we make them here.”

Foxconn, also known as Hon Hai Precision Industry Co, opened its first India factory four years ago. It now operates two assembly plants, with plans to expand those and open two more. India has become an important manufacturing base as the Taipei-based company looks to diversify its operations beyond China.

Succeeding in India has become all the more urgent since US President

launched a trade war last year and announced tariffs on thousands of products manufactured in China, including the gadgetry Foxconn makes for Apple, Amazon and others.

In late August, Trump ratcheted up the rhetoric, ordering American companies to start pulling out of China and citing a national security law as justification. He backed off two days later, but many companies have resigned themselves to an inevitable and costly rethinking of their global supply chains.

“It’s a good business principle not to put all your eggs in a single basket,” says Josh Foulger, who runs Foxconn’s India operations. “We have to find viable and reliable alternatives. Obviously the alternative location has to be competitive. We can’t put a factory in Mexico for manufacturing mobiles. It might have worked 10 years ago, it just won't work today.”

Foulger, 48, grew up in Chennai and attended the University of Texas in Arlington, before returning to India in the mid-aughts to set up manufacturing for Nokia. He joined Foxconn four years ago to help founder Terry Gou establish assembly plants in India, now the world’s fastest-growing smartphone market.

Foxconn’s first India facility started in 2015 in Sri City, a special economic zone where goods can be imported and exported with limited red tape and foreign companies make everything from diapers to train carriages. Foxconn’s plant employs almost 15,000 workers — about 90% of them women — and assembles phones for various manufacturers, including local best-seller Xiaomi. In recent months, workers began testing and assembling Apple’s iPhone X, which will be sold in India first and eventually exported.

A second mobile phone factory opened in 2017 in Sriperumbudur, about two hours by road from the first facility. It employs 12,000 and is partially automated. “By 2023,” Foulger says, “both factories will be much larger and we’ll add two more locations.”

Foxconn currently ships parts in from China, but hopes one day to manufacture displays and printed circuit boards locally. Foulger is angling to capture a third of the domestic smartphone market and 10% of the global one (up from a 2.5% share today). Eventually, he plans to add other products, including

speakers, to the mix. “Until now, India has made for India,” he says. “Soon India will make for the world.”

Seated in an office overlooking the hubbub of the Sriperumbudur plant, the strapping, bearded executive ticks off India’s pluses: labor costs that are half that of China’s, a vast pool of workers including talented engineers, a government eager to help.

They have a staunch partner in Prime Minister Narendra Modi who is under pressure to bring down a jobless rate that currently exceeds 6%. His government’s four-year-old “Make in India” policy seeks to turn the country into a manufacturing power by offering incentives to foreign companies to open factories. “The plan is to expand India’s $25 billion phone manufacturing to $400 billion by 2024,” says Pankaj Mahindroo, who heads the Indian Cellular & Electronics Assn. “A substantial portion of it will be for the export market.

There’s a long way to go: A mere 700,000 electronics manufacturing jobs have been created since Make in India started, according to Mahindroo’s industry group. Skilled workers such as industrial designers are in short supply, and there isn’t yet much of a supplier network providing crucial components such as batteries, semiconductors and processors. “India is not there yet,” says Anshul Gupta, a senior research director at Gartner India. “But things are beginning to fall in place. India can bolster its manufacturing capacity and help the world cut its reliance on China.”

Foxconn was integral to China’s transformation into a manufacturing colossus, and Gou has told Modi that Foxconn could help India do the same. But it took China 30 years to get there. “China’s advantage was its massive labor pool that could produce quite cheaply, and they built on that by investing heavily in logistics and transportation,” says Andrew Polk, a founding partner with Trivium China, a Beijing-based research firm. “Even as their labor pool advantage is dissipating, they have invested in processes and systems so they can produce efficiently at scale and get the goods to the market.”

Catching up will require the Indian government and private sector to invest heavily in roads, rails, ports and other infrastructure. “When China did it, global supply chains were fragmented and there wasn’t another China,” Polk says. “India will not only have to get it right but they have to get it right in a way to better China, and trade wars can only help at the margins." China also had the benefit of being able to grow without worrying too much about the environmental impact. With concern about climate change growing, “that’s not going to fly these days,” he says.

As a two-decade veteran of supply chains in India and elsewhere, Foulger is painfully aware of the challenges. “I can twirl my mustache and say, ‘India can replicate China,’” he says. “The reality is that we have shortcomings.” While the state government provided land, water and power connections for the Sriperumbudur facility, Foxconn, Dell, Flextronics and other companies banded together to build the industrial park for their factories. Even so, Foulger still needs to ferry in water for his thousands of workers because Chennai city and nearby areas have a severe water shortage.

It was Foulger’s mother who planted the idea and persuaded him to give women the opportunity. A teacher whose students often hailed from underprivileged backgrounds, she told him girls are curious, hard working and committed but family circumstances prevent them from going to college. Many are forced to start work early or are pushed into marriage and child rearing at a young age.

Foulger says that because most Indian manufacturers prefer to hire men, it was easy to hit his hiring targets. But he’s had to make accommodations. For instance, the air conditioning had to be turned up to 26 degrees because the woman have never experienced it before. A line manager brought up the issue of sanitary hygiene, and Foulger was initially hesitant. What would be the reaction in their villages, he wondered? Still, he listened and had sanitary pad dispensers installed in the washroom. Foulger also has to pay for extra security for his female recruits and provide buses and dormitory accommodation for those who live far from the factories. But he says it’s well worth the extra cost because “women work hard and appreciate the chances given to them.”

Over the years, Foxconn has been criticized for grueling working conditions at its China factories. A string of suicides of young migrant workers earlier this decade shocked the world and prompted the company to create a help hotline, boost pay and install safety netting to discourage jumpers. In August, Foxconn fired two executives at a Chinese plant that assembles devices for Amazon after a labor group alleged it slashed wages and flouted laws to help deal with rising US tariffs.

During visits to Foxconn’s two India factories, there was no visible sign of sweat-shop conditions. Workers there mostly complain about the monotony. From the minute they enter the shop floor to the end of an eight-hour shift, work repeats in a relentless cycle. The daily production target has to be met at all costs. Row upon row of women put together each phone part by part, inspecting each handset for visible defects. Shivaparvati Kallivettu, 24, spends her days testing the phone’s audio and examining batteries and SIM card trays, explaining that her main respite comes every morning in the factory canteen when she has breakfast with four close friends.

Most women take the jobs with specific goals in mind, such as sending their kids to better schools or clearing family debt. The pay hoists them over the poverty line. Jayadas gets about 9,000 rupees monthly ($130, which is about a third of the average Chinese factory wage), free bus rides and two wholesome meals. To help avoid tedium, the company teaches workers at least 10 skills in the testing, packing and assembly sections of the line so they can be rotated to different jobs. Still, many of the workers treat the job as a stop-gap. Recently, 400 women failed to show up for their daily shift. Managers discovered they were all taking the government’s teacher recruitment exam—a job that pays a third of what they make at Foxconn but provides less tangible compensations.

After her shift, Jayadas boards the bus, reaching her home a little before 4 p.m. She helps with the cooking, then fetches 12 buckets of water from a street tap for the family’s daily needs. Her father’s income repairing radios and DVD players is meager and erratic, and her entire paycheck goes to her parents. “First, the house has to be fixed,” Jayadas says gesturing toward the flimsy roof and decrepit walls. “Then, I want to save up for a beautician’s course.”