LOS ANGELES—The heavyweight legal fight between the federal government and Apple Inc. heads to the courtroom after weeks of public sparring over whether the tech giant should be forced to hack into a dead San Bernardino attacker’s iPhone.
The sides …