Apple Inc. and Google unveiled a rare partnership to add technology to their smartphone platforms that will alert users if they have come into contact with a person with Covid-19. People must opt in to the system, but it has the potential to monitor about a third of the world’s population.

The technology, known as contact-tracing, is designed to curb the spread of the novel coronavirus by telling users they should quarantine or isolate themselves after contact with an infected individual.

The Silicon Valley rivals said on Friday that they are building the technology into their iOS and Android operating systems in two steps. In…