OAKLAND, Calif. — In one of the most far-ranging attempts to halt the spread of the coronavirus, Apple and Google said they were building software into smartphones that would tell people if they were recently in contact with someone who was infected with the virus.
The technology giants said they were teaming up to release the tool within several months, building it into the operating systems of the billions of iPhones and Android devices around the world. That would enable the smartphones to constantly log other devices they get close to through the short-range wireless technology Bluetooth, enabling what is known as “contact tracing” of the disease.
The unlikely partnership between Google and Apple, fierce rivals who rarely pass up an opportunity to criticize each other, underscores the seriousness of the health crisis and the power of the two companies whose software runs almost every smartphone in the world. Apple and Google said their joint effort came together in just the last two weeks.
Their work could prove to be significant in slowing the spread of the coronavirus. Public-health authorities have said that improved tracking of infected people and their contacts could slow the pandemic, and such measures have been effective in places like South Korea that also conducted mass virus testing.
Yet two of the world’s largest tech companies harnessing virtually all of the smartphones on the planet to trace people’s connections raises questions about the reach these behemoths have into individuals’ lives and society.
“It could be a useful tool but it raises privacy issues,” said Dr. Mike Reid, an assistant professor of medicine and infectious diseases at the University of California, San Francisco, who is helping San Francisco officials with contact tracing. “It’s not going to be the sole solution, but as part of a robust sophisticated response, it has a role to play.”
Timothy D. Cook, Apple’s chief executive, said on Twitter that the tool would “help health officials harness Bluetooth technology in a way that also respects transparency & consent.” Sundar Pichai, Google’s chief, also posted on Twitter that the tool has “strong controls and protections for user privacy.”
With the tool, people infected with the coronavirus would notify a public health app that they have the illness, which would then alert phones that had recently come into proximity with that person’s device. Google and Apple added that people would have to opt in to use the tool.
Privacy is a concern given that Google, in particular, has a checkered history of collecting people’s data for its online advertising business. The internet search company came under fire in 2018 after it said that disabling people’s location history on Android phones would not stop it from collecting location data.
Apple, which has been one of the biggest critics of Google’s collection of user data, has not built a significant business around using data to sell online advertising. Still, the company has access to a wealth of information about its users, from their location to their health.
There are already third-party tools for contact tracing, including from public health authorities and the Massachusetts Institute of Technology. In March, the government of Singapore introduced a similar coronavirus contact-tracing app, called TraceTogether, that also uses Bluetooth signals to detect mobile phones that are nearby.
But given the number of iPhones and Android devices in use worldwide, Apple and Google said they were hoping to make tracing efforts by public health authorities more effective by reaching more people. They also said they would provide their underlying technology to the third-party apps to make them more reliable.
One challenge for third-party apps is that they must be running constantly — 24 hours a day, seven days a week — to be effective. Google said some Android smartphone manufacturers shut down those applications to save battery life.
Apple and Google said their tool would also run in the background constantly if people opt to use it, but it would eat up less battery life and be more accurate than third-party apps.
Once someone reports his or her infection to a public health app, the tool will send the phone’s so-called broadcast beacons, or anonymous identifiers connected to the device, to central computer servers.
Other phones will constantly check those servers for the broadcast beacons of devices they had come near in the past 14 days. If there is a match, those people will receive an alert that they had likely come into contact with an infected person.
Apple and Google said they were discussing how much information to include in those alerts with health officials, aiming to strike a balance between being helpful while also protecting the privacy of those who have the coronavirus.
“This data could empower members of the general population to make informed decisions about their own health in terms of self-quarantining,” Dr. Reid said. “But it doesn’t replace the public health imperative that we scale up contact tracing in the public health departments” around the world.
Apple and Google said they would make the tool’s underlying technology available to third-party apps by mid-May and release the tool publicly “in the coming months.”
Ashkan Soltani, an independent cybersecurity researcher, cautioned that surveillance tools that start as voluntary often become required through public policy decisions. China, for instance, has introduced a color-coded coronavirus surveillance app that automatically decides whether someone must stay at home or may go outside and use public transportation.
“The danger is, as you roll out these voluntary solutions and they gain adoption, it’s more likely that they are going to become compulsory,” said Mr. Soltani, a former chief technologist for the Federal Trade Commission.
Natasha Singer contributed reporting from New York.