I bet they rehearsed a dozen times and never failed as bad live. Got to give them props for keeping the live demos. Apple has neutered its demos so much it's now basically 2 hr long commercials.
Live Apple demos were always held together with duct tape in the first place. That first "live" iPhone demo had a memorized sequence that Jobs needed to use to keep the whole phone OS from hard crashing.
During that first iPhone demo they also had a portable cell tower (cell on wheels) just off-stage to mimic a better signal strength than it was capable of. NYTimes write-up on the whole thing is worth the read [0].
They also force the developers to make it work, under threat of being fired, and in the ire of Steve Jobs case, being yeeted in to the sun along with their ancestors and descendents.