There is no solid way for them to search your phone or anything else if you don't let them. The most important rule of being pulled over is leave the window down from the top by no more than an inch and keep the doors locked. If you have to get out of the car (rarely, without consent to search), wait for the cop to be at least 10 feet away before getting out so that he can't force the door to stay open. If you have a door side key pad, lock the keys in the car, otherwise put them in your pocket. If someone else is in the area that has keys, it would also be good just to intentionally lock them in there. As soon as the door is open, re lock the lock, then get out briskly and close the door.
At this point the only things you should be saying are that you don't consent to any searches, and your phone still in the car should be recording or calling porcupine 411. Your spy cam(s) should also have been rolling the entire time. If they want to search the car, make sure they know it will be without your permission, and make them slim jim a lock or ASP a window, then attempt to tell a Judge why they did it, rather than try to claim you didn't object.
If this sounds a bit over board, perhaps it's because I like so many others here have had cops fabricate evidence and lie under oath about my actions, nevermind the felony stops with no RAS. An ounce of prevention is worth thousands in lawyer fees.