Mattingly was named to command STS-4, the fourth and final orbital test flight of the , launched from Kennedy Space Center, Florida, on June 27, 1982, with Henry W. Hartsfield Jr., as the pilot. This seven-day mission was designed to further verify ascent and entry phases of shuttle missions; perform continued studies of the effects of long-term thermal extremes on the orbiter subsystems; and conduct a survey of orbiter-induced contamination on the orbiter payload bay. Additionally, the crew operated several scientific experiments located in the orbiter's cabin and in the payload bay. These experiments included the Continuous Flow Electrophoresis System experiment designed to investigate the separation of biological materials in a fluid according to their surface electrical charge. This experiment was a pathfinder for the first commercial venture to capitalize on the unique characteristics of space. The crew is also credited with effecting an in-flight repair which enabled them to activate the first operational "Getaway Special" (composed of nine experiments that ranged from algae and duckweed growth in space to fruit fly and brine shrimp genetic studies). STS-4 completed 112 orbits of the Earth before landing at Edwards Air Force Base, California, on July 4, 1982. Mattingly and Hartsfield were greeted by President Ronald Reagan after the landing; Reagan recognized the pair, both graduates of Auburn University, as "you two sons of Auburn" in his welcoming speech.