A month after the release of The Last Airbender, Smith contacted M. Night Shyamalan on August 6 to wish him "Happy Birthday" and to persuade him to direct his film with his son Jaden as the star. Smith and Shyamalan had planned to work on a film before but it never worked out. Impressed with the entire script, Shyamalan officially made this project—then entitled One Thousand A. E.—his next directorial effort on October 20, and quietly shelved his own secret untitled project with Bruce Willis, Bradley Cooper, and Gwyneth Paltrow loosely attached. There was another starring role for an adult male, but sources indicated that Smith would not be taking it on. Sony Pictures Entertainment has a first-look deal with Overbrook, so it was expected to be the studio home for A. E. Shyamalan later suggested the film would feature other members of the Smith family, and that it would not be in 3D but he had "an idea for something kind of technically interesting".
In December 2011, Columbia Pictures, a subsidiary of Sony, signed Will and Jaden Smith to star in the film with Shyamalan directing. Shyamalan, who co-wrote the screenplay with Gary Whitta, produced the film with Overbrook's James Lassiter, Smith, Ken Stovitz, and Jada Pinkett Smith. Doug Belgrad, president of Columbia Pictures, made the announcement and said, "Night is an outstanding filmmaker who has a tremendous vision for this science-fiction adventure story and we couldn't be more excited to be working again with Jaden after our experiences on The Pursuit of Happyness and The Karate Kid," and added "We're thrilled to have the two of them together on this project." Shyamalan also added, "The chance to make a scary, science-fiction film starring Jaden and Will is my dream project." Will Smith's decision to take on the starring adult male role required him to step aside in producing and starring in the Hurricane Katrina drama The American Can, and offered the lead role to Denzel Washington instead. The shooting of the movie was also pushed back from September 2011 to January 2012.
On July 25, 2011, Smith traveled to Costa Rica accompanied by an entourage of about 20 people, including Shyamalan, to scout for locations to shoot the film. They visited sites like the Arenal Volcano, hot springs and a lake, and some beaches.
In September, Columbia committed to a June 7, 2013 release date. Shyamalan also scouted locations in Philadelphia. 50% of the filming was to take place at the new Sun Center Studios in Delaware County (Chester Township). Other locations would be in Costa Rica, Utah and Northern California. Shyamalan also visited Valley Forge Military Academy, known for being the filming location of Taps, for research of the film, then entitled After Earth, as Jaden Smith would be playing a military cadet of the future.
The screenplay by Whitta and Shyamalan was later polished by Stephen Gaghan and Mark Boal. Jonathan Young, PhD, from the Joseph Campbell Archives, polished the mythic journey structure.  Principal photography for After Earth began in February 2012. Much of the filming took place in Costa Rica, Humboldt County, and Aston.
After Earth became the first film from Sony to be both shot and presented in the emerging 4K digital format. It was primarily shot with Sony's CineAlta F65 camera, which was shipped in January 2012. However, a skydiving sequence required a smaller sized Canon Cinema EOS C500 4K camera mounted on the helmet of a professional skydriver. The cinematographer Peter Suschitzky who picked Sony F65 digital camera for the movie over other digital and film cameras, argued that benefits of film are lost when shown in theaters with digital projectors, as many are today.
On April 19, 2013, Shyamalan announced that the release date had been moved a week earlier to May 31, 2013 in North America and Korea, which put it against Now You See Me and The Purge, scheduled to open in the United States in the same week. A few days later, the U.S. release of The Purge was rescheduled for June 7, 2013, taking over the slot vacated by After Earth.
On May 3, it was revealed that Korean-American singer Jay Park would be participating on the official soundtrack of the film in Korea, with a song titled "I Like 2 Party". On May 5, a 30-second snippet of the song was released with a trailer.