Warning icon
Russia has attacked Ukraine. Here’s what MacPaw and Setapp are doing to make sure our team members and infrastructure are safe.

How to get rid of a virus on your iPhone

8 min read

Though iPhone viruses are rare, they can happen. Typically, this occurs through a few different methods, but it’s almost never totally your fault. 

Hackers are clever, and are always finding new ways to infect devices for nefarious purposes. You can get a virus from clicking links you don't recognize, or downloading sketchy apps. 

A common method for hackers to load viruses and malware on your iPhone is via iMessage. You’ll get a message telling you something urgent, and encouraging you to click a link to resolve an issue or claim a prize. When you do, your phone is subject to whatever is on the other end – and it’s almost never good.

If you believe your iPhone has a virus, we’ll show you how to clean your phone from virus threats, how tog et rid of a virus on your phone already, and discuss some apps that can help keep your Mac and iPhone safe from harm.

How to find out if My iPhone Has a Virus or Other Malware?

Plainly put, your iPhone will be acting strangely. Devices with viruses or malware are often slow, and can hijack normal functionality, like search. This is why removing viruses from iPhone or iPad is so important. 

If your phone is acting abnormally, consider what links you may have clicked recently. There’s no Safari virus on iPhone, but Safari can be a gateway for hackers to load malware  or other bloatware onto your device. 

You should also think about which apps you've recently downloaded. Apps are a direct way for hackers to gain entry to your phone, and it's not always as direct as it seems. Developers often use snippets of code called APIs that are open source to access services in the cloud, and hackers have been known to inject malware and viruses into APIs. 

Though this article will show you how to clean your iPhone from virus threats, prevention is still the best path forward. Don’t click links you’re not confident in, and don’t download sketchy apps from any source.

Why are iPhone viruses so rare?

Apple does a really good job of keeping the iOS ecosystem locked. The ‘walled garden’ keeps virus threats at bay. Though some threats have been detected, Apple’s diligence keeps the volume of viruses on iPhone really low.

Code developers submit is also checked routinely for suspicious API calls or strange text. When the review team detects an issue, they communicate with the developer.

How To Remove a Virus from iPhone

Now that we know why it happens, let’s discuss how to get rid of virus on phone and keep it from occurring again.

Delete apps that look suspicious

Dig through the apps on your phone: do any look suspicious? Do you recall downloading each of them, and do you use them often enough to keep around?

The answer to “how do i get a virus off my iPhone?” is often as simple as deleting an app. Apps have associated files, and deleting them typically removes the files they imported. All you need to do is press and hold on the app icon, and select “Remove App” from the menu that appears. 

delete app iphone

Clear history and website data

Understanding how to delete virus from iPhone history is critical, too. Viruses can live in your browser history or website data, especially if you revisit a suspect website on your phone often. Viruses can re-inject files onto your phone, perhaps doing more damage. 

Here’s how to reset your website history and data:

  1. Open the Settings app on your iPhone
  2. Select “Safari”
  3. Select “Clear History and Website Data”
  4. Choose “Clear History and Data” from the menu that appears

Clear History and Data iphone

Restart your iPhone

Viruses and malware often happen while your phone is operating, and shutting your phone off completely can stop a virus or malware form working. It’s a simple measure that can often save you a lot of headache.

Keep in mind you will have to shut your phone down; putting it into Airplane Mode won’t do the trick. All you have to do is hold down the power button on the left side of your iPhone and the volume up button on the right side for a few seconds. On the screen that appears, slide the icon at the top of the screen to power your phone off.

Restore your phone from a previous backup version

Apple provides a small sliver of iCloud storage for backups, but it’s often not enough to store many backups. It’s also not a useful method if you’ve had a virus on your phone for a long while. Each backup iCloud has may also be corrupted!

This is why it’s best to have your own backup program, and why AnyTrans is an app you should download for Mac right away. 

AnyTrans allows you far more control over your backups than Apple allows via iCloud. The app allows you to download any files or folders to your Mac, and sync iOS devices to your Mac’s storage. The wired connection to your Mac also sidesteps the often clumsy iCloud syncing protocols, and lets you get direct access to backups of your iPhone stored on your Mac or an associated external drive.

Because you have full control of where your backups are housed – and how many you hold onto – you can keep a reliably safe backup of your iPhone tucked away, and restore to it if you ever run into issues with viruses or malware on your iPhone. AnyTrans is really the safest solution for backing up and syncing your iPhone.

anytrans ios

Reset with Factory Settings

If all else fails, or you simply want to start completely over with your iPhone, you can always reset your device to factory settings and start anew. Know that any data you haven’t backed up will be lost, so it’s a good idea to take advantage of everything AnyTrans has to offer before going this route.

First, you’ll need to remove your iPhone from Find My iPhone, if it’s enrolled. Here’s how:

  1. Open the Settings app on your iPhone
  2. Select your name banner at the top of the screen
  3. Select ‘Find My”
  4. Select “Find My iPhone”
  5. Toggle all settings off

find my iphone

To reset your phone to factory settings, follow these steps:

  1. Open the Settings app on your phone
  2. Select “General”
  3. Select “Reset”
  4. Select “Erase All Content and Settings”
  5. Enter the passcode for your iPhone
  6. Tap “Erase”

erase all settings iphone

Your phone will begin the process of deleting all of your data and settings. It will then reboot as though it were a brand new phone.

Tips how to keep your iOS device secure

Remember, preventing issues is far better than solving them! Now that you know to never click a link you’re not totally sure is legitimate, here are a few extra tips to ensure you never get another virus on your phone.

Download apps only from Appstore

Getting apps via other sources is possible, but you should never do it. Always download apps from the App Store, and never ‘sideload’ apps from the web or a secondary app marketplace.

When downloading apps, always read reviews. If an app has a low rating, it may be because users notice signs of a virus without understanding the app is at fault. If review note the phone slows down when the app runs or any other odd behavior, skip the download.

Keep iOS system updated

Each time Apple updates iOS, it comes with tons of security improvements. Apple never discusses what fixes it has made, but the latest version of iOS is always the safest. 

Similarly, don’t download older iOS builds unless it’s directly from Apple. Even if you’re not crazy about the latest and greatest version of iOS, it’s safer than downloading iOS from somewhere else, which could itself carry viruses and malware.

Keep app Updated

You know how app updates often say “bug fixes and improvements”? That’s because ‘bugs’ and ‘improvements’ are often security patches! 

Always keep your apps up to date. Apps that haven’t delivered updates in a long while may be carrying malware, too. Remember how we told you Apple checks code for suspicious activity? If a developer knowingly added a virus to their app and ships an update, Apple will check the code and hackers can be caught.

Pro tip: free gigabytes from unused file and photos

Keeping your Mac and iPhone in sync is popular, as having the same files, folders, and images across all of your devices just makes life easier. You can free up precious space for your synced apps, files, folders, and images with Gemini.

Gemini is dedicated to finding duplicate files, and deleting them if you choose. Your iPhone and Mac being totally harmonious sometimes means files and images are duplicated, causing unnecessary storage space to be occupied. You could ignore this, but why? Duplicate files are just clutter you don’t need.

gemini app

Cleaning your Mac with Gemini and syncing your folders and images to iPhone ensures storage across your devices remains clear and concise, and you only keep the files you really want and need.


Viruses on Mac are never fun to deal with, so be sure to take preventative measures. The last thing you’d want to do is have to reset your phone just because you clicked a strange link in a text message!

Gemini and AnyTrans help keep your iPhone synced, backed up, and free of unwanted files. Both are available for free as part of a seven day trial of Setapp, the world’s most robust suite of apps for your Mac. While these two apps alone are reason enough to give Setapp a try, there are nearly 200 other apps available in the Setapp suite you’ll love, too.

When your trial ends, access to Setapp is only $9.99 per month. It’s an incredible bargain for access to over 200 apps, so why hesitate any longer? Give Setapp a try now!

Get 230+ Mac apps for any job

Sign up to Setapp and try them for free.