Barr made the request during a media conference on Monday at which he announced details of the incident. The FBI had already asked Apple for help last week.
Alshamrani, a member of the Royal Saudi Arabian Air Force, was attending a training course in the US. The incident has been designated a terrorist act.
Barr said during a gunfight with law enforcement officials, Alshamrani fired a single round into one of the iPhones. The second iPhone was also damaged during this encounter.
"However, both phones are engineered to make it virtually impossible to unlock them without the password. It is very important to know with whom and about what the shooter was communicating before he died."
Barr said he had asked Apple for help in unlocking the shooter’s iPhones.
"So far Apple has not given us any substantive assistance. This situation perfectly illustrates why it is critical that investigators be able to get access to digital evidence once they have obtained a court order based on probable cause.
"We call on Apple and other technology companies to help us find a solution so that we can better protect the lives of Americans and prevent future attacks."
In 2016, the FBI similarly sought Apple's help in gaining access to data on an iPhone belonging to a terrorist who had killed Americans in December 2015.
That finally ended up in court, with Apple refusing to do what the FBI asked: create a modified version of its iOS operating system that allowed the agency to use brute-force methods to find out the passcode on the device.
In the end, the FBI obtained the data on the phone by using the services of a private company.