As opposed to trying to physically stop them?
The advise is sound. Do NOT consent to a search, make it clear you do not consent to as many people as possible. Even if you don't think you have anything to hide, do NOT consent to a search, ANY search... Ever... Period... You don't have to be obnoxious or disrespectful to make it clear you do not consent.
If you think they are searching your phone, say something like "Officer, I didn't give anybody permission to search my phone and I object to you looking at it." If they ask you why, you only need to repeat "Officer, with all due respect, I do not give permission for any searches." If they ask you if you have anything to hide, keep saying the same thing.
Further, I would recommend that you not answer any questions they may ask either. Once you have provided your identification, you are done answering questions with anything but "Respectfully officer, I am not required to answer your question. May I leave now?" If they say "No" or indicate that you may not leave, then you ask "Am I under arrest?" If they say you are not under arrest start the process at "May I leave now?" and keep going around the same bush until they let you leave or arrest you. Once they arrest you, SHUT UP. Say nothing but "I want my lawyer present before I will answer any questions." If they let you go, GO!
Follow this process, even if you have nothing to hide. Where it may seem to be a pain, you literally have NOTHING to gain by consenting to searches or answering questions and doing so may cost you, so it makes no sense to be cooperative. If they come to your door, don't invite them in, just step outside and close your door behind you. Remember, no answers to their questions, and no permission for any searches. Go back inside once they let you go.