CUPERTINO, Calif — I’m standing in a warehouse parking lot at an undisclosed location just a few miles from Apple’s headquarters here.

The company, once known for keeping massive projects a secret, has recently been battling a string of product leaks. But as I try to figure out exactly where I am, I’m told Apple is ready to pull the sheets off something that’s been more than three years in the making. Something that, Apple believes, has never been done, or seen, before.

As we walk toward the warehouse, the doors automatically lift from above. Inside, boxes crowd the space. But positioned a few steps beyond the entrance is what we’ve come here to see: a large machine, encased in glass, that occupies almost the full width of the facility.

"This is Liam."

Image: Apple

Liam is a large-scale robot, with 29 freestanding robotic arms at various skill stations. But while most assembly-line robots help put together products you'll one day hold in your hands, Liam is hard at work disassembling your ruined, returned iPhones.

Liam was revealed at Apple’s spring product launch event on Monday, but Mashable got an exclusive look at the system in action a few days earlier. To keep Liam a secret, I’m told, only a handful of Apple staffers knew of its existence.

The iPhone 6S users who trade in their devices at Apple retail stores probably aren't aware of what happens next, either. The iPhones — the majority of which have suffered from liquid damage, like a drop in the toilet — are shipped to one of two distribution centers in the United States. After manual inspection, devices with salvageable components are shipped to Apple’s mystery warehouse so Liam can give them a more productive afterlife.

The thinking behind the concept is that Apple assembled the iPhone in the first place, so who — in theory — is better fit to take it apart than the maker itself?

Liam’s mission

Image: Apple

In creating Liam, Apple is trying to address a growing problem for the consumer electronics industry. Electronics waste, particularly waste from batteries, is a growing hazard in developing nations, where much of this waste can ultimately wind up. Creating recycling programs in the U.S. is one thing that can help, since environmental laws are relatively tough here, and consumer demand for greener products is strong.

However, spreading this across Apple’s international footprint may be a bigger challenge.

Liam is programmed to carefully disassemble the many pieces of returned iPhones, such as SIM card trays, screws, batteries and cameras, by removing components bit by bit so they’ll all be easier to recycle. Traditional tech recycling methods involve a shredder with magnets that makes it hard to separate parts in a pure way (you’ll often get scrap materials commingled with other pieces).

Liam separates the insides of an iPhone with robotic precision so, for example, pieces of glass and plastic won’t be mixed in with copper. Ultimately, these components can be sold to recycling vendors that focus on specific materials, such as nickel, aluminum, copper, cobalt and tungsten (a conflict mineral), and turn them into something else that can be reused, rather than dumped in a landfill. Some of these materials take decades to decompose and leak toxic materials into the ground along the way.

The insides of an iPhone 6S, as revealed in a teardown photo by iFixit.

According to DoSomething.org, 20 to 50 million metric tons of waste from gadgets are annually disposed. In the U.S. alone, waste from electronics represents 2 percent of trash in landfills, but it's responsible for 70 percent of its toxic waste.

Some environmental groups have criticized Apple, along with other tech companies, for “greenwashing” poor environmental records when it comes to electronic waste. They've also pointed out the working conditions in developing nations where most of the company's products are manufactured.

Liam is an attempt to begin addressing the mounting problem of e-waste, but it is not yet proven at a large scale, and it only disassembles one model or one device that Apple makes.

Unlike its many patents and proprietary features, Liam is one effort Apple says it hopes its competitors will copy. As of now, no one else (that Apple knows of) is disassembling tech products in this way to make it easier to reuse the materials rather than mine the Earth for more.

Apple declined to comment on how much it cost to build Liam.

How Liam works

Liam was given its name by a small team of engineers early on in the development process — and no, it’s not an acronym (our first guess was it stood for “large inverse assembly machine”). But like a baby at birth, Apple says the robot just looked like a “Liam” and the name stuck.

Image: Apple

Liam doesn't look like an anthropomorphic robot you might imagine doing this type of work — it's no WALL-E or Terminator. Instead, Liam's massive stature resembles a standard horizontal assembly line, and it makes sounds you'd expect from a system like this: There's a steady hum from motors and moving parts, accompanied by clanks of iPhone components dropping into containers.

While Liam makes up the entire system, its 29 robotic helpers do the handy work. Some have drills, others screwdrivers and suction cups. After a warehouse worker puts several iPhones onto a conveyor belt (it can fit about 40 at a time on the entrance section), the process begins. It's clear this is a well-oiled operation; after all, it took years to perfect, and the research is still ongoing.

Image: Apple

The first robot removes each iPhone's screen from the back casing. The pieces are transported via conveyor belt to another section where the battery is carefully removed. Batteries, which can be damaged or punctured during disassembly, are a health and safety issue for operators, but Liam takes the human element out of that risk.

Pieces are collected in various ways: The screws are sucked up into small tubes and are housed in a nearby container, while SIM card slots are dropped into a small bucket below the system. Each section has a small tablet display — which is, surprisingly, not an iPad — that tracks the internals of the robot and progress of the devices that pass through; if there are issues with removing a component (e.g., it gets stuck in the casing), a “failed attempt” message will show up here. Or if there’s an issue with the battery’s temperature being too high, the system will take note of it.

At some stations, robots worked in pairs; because some iPhones come back with corrosion, the first robot may try five times to remove a screw, while the second is free to move on to another task on the same device without slowing down the process. Apple claims that Liam yields a 97 percent success rate for removing each component.

Apple has optimized the line so if one robot breaks down, the entire process can continue for about 30 minutes until a backup occurs. If the issue isn’t quickly fixable, an operator can temporarily step in to handle the task at that station while another engineer repairs the robot.

Liam completes an iPhone disassembly process every 11 seconds, with dozens running through the system at all times. About 350 units are turned around each hour, equivalent to 1.2 million iPhones each year. Apple wouldn't say when Liam started its work, but emphasized the project is still in the research and development stages.

As of right now, the company puts Liam to work Monday through Friday — it gets the weekend off.

From concept to reality

Apple employees conduct an audit at its partner recycling center in France, a traditional recycling facility. Image: Apple

Liam was designed by a small group of engineers hired specifically for the project, while another Apple team wrote the programming code for the disassembly process.

To figure out how to best break down an iPhone, Liam’s engineers closely studied the components that go into the smartphone. Through the development process, the team visited shredding technology plants and realized that automation, with the help of robots, would be the most efficient way to remove the materials intact.

The first version of Liam, a proof-of-concept model that was never intended to deal with high production volumes, was built to disassemble the iPhone 5. Unlike Liam's current 29-armed incarnation, the earlier version had just one arm and a collection of tools it used to remove all the parts by itself.

While certain processes were replicated from the first version and others were abandoned, the engineers learned more about streamlining the machinery. Figuring out how to remove the battery alone took up a significant amount of time and resources, with a lot of trial and error, Apple says.

The bigger plan

Apple is protecting 36,000 acres of land across the Reed Forest in Maine. Image: EcoPhotography

While plans for more Liams are underway — with one close to production in Europe — this is a part of Apple’s larger effort to become a fully sustainable company. For now, Liam supports only iPhone 6S devices, but there’s opportunity for it to expand to other iOS models, from iPods to iPads, in the future.

Apple has been an increasingly vocal advocate of green initiatives in recent years, a push spearheaded by CEO Tim Cook. In 2014, he famously quieted skeptic investors after some questioned how the company’s renewable energy programs would impact its bottom line. Angered, he said, “If you want me to do things only for ROI reasons, you should get out of this stock.”

While Apple’s recent initiatives have been applauded by the U.S. government and environmental groups, it hasn’t always been that way. In 2004, Apple was publicly criticized by Greenpeace for not removing toxic chemicals in its products, something other tech companies such as Samsung and Nokia were already doing at the time. Several years later, Greenpeace launched a “Green my Apple” campaign to generate buzz about the issue and attract the attention of then-CEO Steve Jobs. Soon after, Jobs responded with news the company had plans to become a greener organization.

Image: Apple

Now, Apple claims sustainability is one of its biggest projects. All of its U.S. facilities and operations are powered by 100 percent renewable energy, and its new headquarters — Apple Campus 2, scheduled to open in 2017 — is designed largely using eco-friendly materials and technology, like the solar panels covering the main building's roof. Apple is also working with the Conservation Fund to plant trees across hundreds of thousands of acres in the U.S.

Apple has green on the mind internationally, too. Last fall, the company announced it is generating clean energy for all of its corporate and retail operations in China and unveiled a major solar power push in Singapore.

However, it still has a ways to go to reach the point where it is generating clean energy for all its manufacturing facilities in Asia.

Meanwhile, Apple also announced on Monday that its existing iPhone return policies will be rolled into one overarching program called Renew. It will blend Apple's take-back initiative, where customers bring in devices to be recycled; Apple Care, which allows users to get new devices when their own is beyond repair; and the Apple trade-in program for those who want device upgrades. But rather than giving customers a gift card or cash back to buy more stuff, Apple will be encouraging users with other incentives.

Image: Apple

Apple is not only working to make more components recyclable, but it also hopes customers feel more in control of doing something right for the environment.

It's clear Apple doesn't want to keep Liam a secret any longer. Its presence goes beyond the mysterious warehouse near Cupertino, with Apple's aspirations to inspire and motivate other tech companies to take a similar responsible recycling approach. In time, Apple hopes, consumers will expect all tech gadget makers to take similar actions to cut down on waste and protect the environment.

While Liam is Apple’s first attempt at moving the recycling industry away from shredding, its existence could mark the beginning of a major shift in how products are built, used, broken down and recycled into brand-new products.

For a company that has perfected the art of announcing new products, it's an important step in figuring out the science of decommissioning the old ones.

Science Editor Andrew Freedman contributed to this story.