In most cases, a factory reset will eliminate viruses from your phone. However, certain viruses survive factory resets and can be very difficult to get rid of. It’s better to use an app like Certo Mobile Security for Android or Certo AntiSpy for iOS to identify and remove viruses.