Uber’s use of Greyball was recorded on video in late 2014, when Erich England, a code enforcement inspector for Portland, Ore., tried to catch an Uber car downtown as part of a sting operation against the company.

At the time, Uber had just started its ride-hailing service in Portland without seeking permission from the city, which later declared the service illegal. To build a case against the company, officers like Mr. England posed as riders, opening the Uber app to hail a car and watching as the miniature vehicles on the screen wound their way toward him.

But unknown to Mr. England and other authorities, some of the digital cars they saw in their Uber apps were never there at all. The Uber drivers they were able to hail also quickly canceled. That was because Uber had tagged Mr. England and his colleagues — essentially Greyballing them as city officials — based on data collected from its app and through other techniques. Uber then served up a fake version of its app that was populated with ghost cars, to evade capture.