Even assuming you're right that this would be justified in a war context, the problem is that, if this tool is created, the government would not hesitate to use it in other contexts.
Today, they want to unlock a dead terrorist's phone. Tomorrow, it might be a drug dealer. Or someone suspected of insider trading. Or Ammon Bundy. Or you, or me or anyone reading this.
They want APPLE to do it on that one phone. Both Trump and Cruz do. Neither asked for Apple to put this tool into the public or even the government’s hands.
You can say that about government having an atom bomb, too.
The threshold of the Constitution is to declare war, which we have kind of soft pedaled as hostilities, but so far we still know what we mean.
We are looking at the wrong set of issues. We shouldn’t be looking at the how, but at the what.