No, a cop cannot search your phone if you’re pulled over or caught for texting and driving. The statute includes built-in safeguards to protect those who are pulled over, including the fact that an officer must inform you of your right to decline a search of your device.
It is illegal for a cop to access or search your device without a warrant. Police also cannot confiscate your device while waiting for a warrant and cops cannot coerce you to submit to an unlawful search. If police ask to see or search your phone or your car, politely tell them "no."