Relying on a GPS device placed in a decoy pill bottle, police officers tracked an armed man suspected of robbing a pharmacy and fatally shot him during a confrontation on the Upper East Side, police said.