You can create the software on a CPU emulator. You cannot install it on the real iPhone without the Apple Signature. It's like learning to fly on a flight simulator and actually flying a plane. Difference is night and day.
I meant that one could emulate the entire iphone CPU and system in a powerful enough software emulator. All the Apple stuff would run on the emulator. Anything in hardware would be reverse engineered from examining the device and emulating it, and/or monitoring the signals in a non destructive manner. It’s a physical device, not a magic black box.
What would happen if someone in China, or NK, or ISIS had invented cell phones now in common use in the USA? How would we ever begin to enforce such an order on such a presumably antagonistic party in a foreign jurisdiction? I think we would put some geeks on it to reverse engineer it and build a replica, and then run the code on it. But if we could not do it in the USA, then I imagine that we would outsource it to Moscow or somewhere with inexpensive but very well educated labor. Whatever it takes. If we still could not do it, then own up to it as being too difficult. and live with it. I am probably missing a lot.