In the message, McKinney allegedly told him not to come to school.
The two suspects are accused of carrying out a mass shooting at STEM School Highlands Ranch near Denver in May, killing Kendrick Ray Castillo, 18, and wounding eight others.
Following the shooting, Erickson told investigators that McKinney made him do it and tasked him with guarding an exit and telling everyone not to move.
Erickson took the two handguns used in the shooting from his parents, according to a law enforcement source.
The two students used the middle school entrance because they knew they would be able to get the guns into the school, the affidavit states.