War has certainly led to a lot of technological innovation, but we've also seen a lot of innovation in piece times. I'm not sure the assessment of the technology in the iPhone you are presenting is 100% fair as I wouldn't say that all military spending during piece times can or should necessarily be viewed as innovation brought on by war. I would say preparation for possible war and real war are not the same. Still, I wouldn't say that this invalidates your point or even this specific example by any means as you could say preparation for the potentiality of war
But I would surely agree that war is like competition on steroids, but I wouldn't say it's the only way to encourage innovation. I think technological innovation is currently thriving and it's being fueled by the good old regular free market competition not just war. I would say a global market and global competition has created more value for humanity than war with value including both technological progress and prosperity in general. When there is war, technological advancements might be happening, but they are not leading to prosperity and making the lives of people better, so they are not really creating real value for society while the conflict itself is destroying value in mass amounts. Humanity can take advantage of those technological advancements only in peace times for the most part.