Despite the work they continued to put into the track, the group considered abandoning the song, as they could not find an arrangement they liked. Bono and his friend Gavin Friday continued to work on the song after Lanois and Eno declined to do so. Bono credits Friday with rescuing the song and rearranging it, believing it could be a hit. Eno added a keyboard arpeggio, similar to the one from "Bad". The song's fate was still in doubt when the Edge was sent a prototype of the Infinite Guitar by Canadian musician Michael Brook, with whom he had collaborated for the "Captive" soundtrack. The instrument allowed sustained notes to be played, producing "a similar effect to the E-Bow", but with the ability to provide all the "mid-points between no sustain and infinite sustain" that the E-Bow cannot provide. The prototype included elaborate assembly instructions and as the Edge recollects, "one wrongly placed wire and you could get a nasty belt of electricity. This piece of gear would have failed even the most basic of safety regulations." On subsequent tours, his guitar technician occasionally received electric shocks from the instrument when preparing it for performances. Listening to the backing track to "With or Without You" in the control room, Bono and Friday heard the sustained effect that the Edge was creating with the Infinite Guitar in the other room. The combination of the two playing simultaneously caught their attention. According to Lanois, "I said, 'That sounded pretty cool,' so we listened back and I said, 'Jesus, it's better than I thought.'" The Edge immediately recorded an Infinite Guitar part in two takes. The band considers the song's recording to be one of the album sessions' breakthrough moments, as it was recorded amidst concerns that they had run out of ideas. Eno sequenced the song's electronic drum beat on the Yamaha DX7 synthesiser. Rather than connect it to the recording equipment via a DI unit and maintain the instrument's pristine sound, the producers plugged it into a Mesa Boogie guitar amplifier and then miked it to give the sound more personality. As a result, Lanois said it sounded "more like people playing in a room". The sequenced beat was chosen to give the song a feeling of discipline, so that when Mullen's acoustic drums enter the song, "they mean something", in Lanois' words. Producer Steve Lillywhite was hired by U2 in December 1986 to help mix some songs for "The Joshua Tree"; "With or Without You" was one of them.