Has anybody on Quora ever found a hidden camera or voice recorder using the magnetometer on their smart phone?
What smartphone has a magnetometer?
And even if one did, I am not sure that a magnetometer would even detect such devices. A magnetometer is designed to detect ferrous metals and magnetic fields.
Tiny, hidden CCTV cameras and microphones are unlikely to even contain those items.
Using your smart phone to detect surveillance is pretty dumb - unreliable and unprofessional.
You want to get your hands on a professional Linear Junction Detector to do this...