Both SpaceX and Boeing are busily preparing for the first crewed launches of their commercial spacecraft, and in case something goes wrong, they're simulating different types of emergencies.

The companies are contracted under NASA to provide commercial crew spacecraft for missions to the International Space Station (ISS) to supplement the Russian Soyuz spacecraft that is currently used for all ISS launches, which blast off from a facility in Baikonur, Kazakhstan. The first commercial crew astronauts will fly late this year or sometime in 2020, if all goes according to plan. SpaceX and Boeing will each launch their spacecraft from Florida, marking the first time American astronauts have launched from their home country since the last space shuttle mission in 2011.

SpaceX and NASA geared up for the first launch of a Crew Dragon with astronauts aboard with a dress rehearsal of launch day — including simulated emergencies. NASA astronauts Bob Behnken and Doug Hurley, who will fly the first Crew Dragon mission, practiced suiting up in a SpaceX facility in Hawthorne, California, with SpaceX's ground closeout team. The NASA and SpaceX teams did a simulated launch countdown, as well as several emergency launch scenarios, which is common practice for all astronauts preparing for spaceflight.

Some of Boeing's first CST-100 Starliner crew also conducted emergency launch scenarios at Space Launch Complex 41 at Cape Canaveral Air Force Station in Florida. NASA astronaut Josh Cassada, who will be on the first Starliner crew, participated in the exercise, as well as Eric Boe (who initially was assigned to a Starliner mission, but pulled for medical reasons in January) and astronaut candidate Jasmin Moghbeli (who is completing certification exercises to qualify for future spaceflights).

Our @Commercial_Crew Program is making progress to launch astronauts from U.S. soil to the @Space_Station. Learn about our rehearsals to safely extract crew members from the @SpaceX #CrewDragon spacecraft that will carry astronauts to & from space: https://t.co/0k1PovEqKA pic.twitter.com/km24W9FfhfAugust 18, 2019

What’s new with our @Commercial_Crew astronauts? @AstroBehnken and @Astro_Doug recently performed suit-up & leak checks using the same Ground Support Equipment hardware that they will use for launch on @SpaceX’s Demo-2 mission. Keep up with their training: https://t.co/irbF3GDaC3 pic.twitter.com/lqIsMGWjYIAugust 8, 2019

The astronauts and ground personnel followed a complicated set of procedures to practice safety in the event of a sudden emergency on the pad, such as a rocket explosion. Such an event could offer only seconds to respond, so practicing everything ahead of time is necessary. During the drill, participants donned portable respirators and practiced moving from the crew access arm on the spacecraft, which is nearly 200 feet (60 meters) high, toward a zip line, which they slid down to a staging location on the ground.

Once everyone reached the ground safely, they rushed inside a vehicle designed to withstand any debris from a disaster. The team drove the so-called mine-resistant ambush-protected vehicle almost a mile (1.6 kilometers) to a helipad, where flight surgeons and emergency personnel were ready with ambulances and a decontamination vehicle.

Emergency response personnel surround an astronaut with simulated injuries during an exercise conducted by NASA, Boeing and United Launch Alliance on July 24, 2019.

(Image credit: NASA/Ben Smegelsky)

"Astronauts evacuating from a pad emergency may come into contact with hazardous substances, such as fuel from the rocket or spacecraft, and must be decontaminated to allow medical personnel to safely treat them. In a true emergency, anyone injured would then be transported via helicopter to area hospitals," NASA said in a statement about the Boeing exercise.

Another practice exercise focused on recovery operations with SpaceX, using a ship called "GO Searcher," which is one of the vessels that will pick up spacecraft and astronauts splashing down in the Atlantic Ocean after a mission. In this exercise, the teams simulated that Behnken and Hurley needed to be extracted from Crew Dragon. The astronauts were removed and received a mock medical evaluation before they were transported to a nearby airport, the Cape Canaveral Air Force Station Skid Strip.

.@NASA led a simulation with @BoeingSpace and @ulalaunch in preparation for upcoming crew flights to the @Space_Station. In the event of an emergency, astronauts and support teams would need to exit the launch pad as quickly as possible: https://t.co/lG6ZspSztG pic.twitter.com/UAgbmm6UZIAugust 5, 2019

"We're making sure that the team integrates together — that's a key to any successful mission," Ted Mosteller, the NASA recovery director in charge of the agency's team for the Commercial Crew Program, said in a statement concerning the recovery operations. "We worked on successfully doing what we need to do to take care of the crew once they return to Earth."

In the same statement, Behnken said he is looking forward to his opportunity for spaceflight and returning to the ISS. "Each of these exercises puts us one step closer to fulfilling NASA's mission of returning astronauts to the International Space Station from U.S. soil," he added.