If you’re thinking of selling or trading in your current iPhone ahead of the iPhone 6S’s release, you probably know that you’ll need to wipe your device before a buyer can use it free and clear. Prepping an iPhone for resale used to be almost as easy as hitting a “reset” button in the iPhone’s settings menu. But over the past few years, the process has become more complex thanks to new security, wallet, and cloud-dependent features such as Activation Lock, Apple Pay and iTunes in the Cloud. Completely removing all of your personal items from your iPhone — and your iPhone from Apple’s servers — requires extra work.
Today, I’m going to walk you through the process of thoroughly scrubbing your iPhone prior to resale. There are 9 steps to take to make sure your device is cleaned up and ready to sell to its next owner. Here they are…
 Erase All Content And Settings. The first, easiest, and best-known step in wiping your iPhone is found within the Settings app at the bottom of the General menu: click on Reset, then “Erase All Content And Settings.” (I’d suggest taking this step only after using iTunes to do two complete, encrypted backups of your iPhone to your computer. If you’re planning to move from iPhone to a non-Apple smartphone, follow Apple’s guide to deactivating iMessage before erasing your phone, as well.)
You will be prompted to enter your iPhone’s passcode, then told that “this will delete all media and data, and erase all settings.” If you press the Erase iPhone button, iOS will ask you for your iCloud account password to “erase this iPhone and remove it from your [iCloud] account.”
You’ll be surprised at how quickly the iPhone is wiped — as soon as you’ve entered your password and hit erase, you’ll get a notification email on your account’s other devices that Find My iPhone was disabled, and it should take only a couple of minutes for the wiped iPhone to display “Hello” and “Slide to Set Up” text. Is the erasure secure? Well, all of the iPhone’s memory is protected using AES-256 encryption, and hitting the Erase iPhone button destroys the encryption key. Several security companies have tried to offer ‘secure erase’ tools that more aggressively scrub the iPhone’s memory, but Apple has shut those tools down as ‘misleading,’ noting that the encryption is effectively unbreakable. Hitting the Reset button leaves the former contents of your device all but completely impossible to recover by a subsequent owner. But you’ll be able to get everything back from your computer’s encrypted iTunes backup, should you need it.
 What About Activation Lock + Disabling Find My iPhone? As shown above, you can manually disable Find My iPhone by going into the Settings app’s iCloud menu, pressing the Find My iPhone “On” button, flipping the Find My iPhone switch to off, and entering your iCloud password. But if you use the Erase All Content And Settings feature above, this step is automatically handled for you when you enter your iCloud password at the end of the process. Either method will disable your iPhone’s “Activation Lock,” the security system that allows you to locate, remotely wipe, and send signals to an iPhone no longer in your possession. Any purchaser of a used iPhone will expect you to have taken this step (or more wisely, the step above) before selling your device.
 Apple Pay/Credit Card and Touch ID Fingerprint Wiping. If you’re using an iPhone 6, iPhone 6 Plus, or newer iPhone, erasing your iPhone will automatically purge whatever credit cards and fingerprints you’ve stored in your iPhone. (Even attempting to disable fingerprint protection for your device will prevent it from storing cards for Apple Pay.) You will probably receive a collection of emails from your banks noting each “Virtual card” that has been “deleted from Apple Pay,” and you may also receive notices of the card’s deletion from your Apple Watch. If you want to manually remove individual cards or fingerprints, the Settings app’s Touch ID & Passcode menu handles prints, and the Passbook & Apple Pay (iOS 8) or Wallet & Apple Pay (iOS 9) menu handles cards. But even if you delete cards for Apple Pay, your iPhone can still store card numbers for Safari web transactions; they can be deleted under Settings > Safari > AutoFill > Credit Cards.
 Carrier Lock + Clearing The ESN/IMEI/MEID. Buyers of used iPhones want to avoid purchasing devices that are either stolen, or still under contract with a cellular company. The status of an iPhone can be checked using a device-specific serial number that’s called an IMEI (International Mobile Equipment Identity) number, ESN (Electronic Serial Number), or MEID (Mobile Equipment Identifier). IMEIs have traditionally been used by GSM networks (AT&T/T-Mobile), while ESN/MEIDs are traditionally used by CDMA networks (Verizon/Sprint). Fourteen or fifteen digits long, the number can be found in Settings > General > About > IMEI or MEID.
If you purchased your iPhone without a contract or have fully paid off your contract, the serial number should be free and clear for transfer. Should the phone be locked to a specific carrier, you can contact the carrier to request that it be carrier unlocked prior to selling it, which will dramatically boost its trade-in value at services such as Gazelle. If you bought your iPhone used, or were given the phone by a family member, this free serial number checker can let you know if the serial number is clear, giving you a sense of reported ownership/theft issues with your device. If your phone’s serial number isn’t clear, contact your cellular provider to get the device paid off. And if you’re trying to sell a stolen phone… return it.
 iCloud. As it turns out, erasing your iPhone only partially removes it from your iCloud account. Using your Mac, go to OS X’s Apple menu, choose System Preferences, then choose iCloud and click Account Details. Select the Devices tab, then highlight your iPhone, and choose Remove From Account. Then hit Done. I found my iPhone 6 Plus on the list twice, for reasons unknown.
 iTunes in the Cloud. In one of its more confusing branding efforts, Apple in 2011 introduced both iCloud — an email, backup, and data synchronizing service — and iTunes in the Cloud, a virtual media locker that allows you to download previously purchased iTunes content for free. Surprisingly, removing an iPhone from iCloud doesn’t remove it from your iTunes in the Cloud account. To do that, you’ll need to open iTunes, go to your account (currently next to the Search bar, signing in with a password under Account Info), scroll down to iTunes in the Cloud, and choose Manage Devices. When you see your old iPhone on the list, hit the Remove button. This will free up one of your 10 allocated media sharing spaces, and enable the iPhone to be registered by someone else for iTunes in the Cloud.
Note that I went to do this for my iPhone, purchased in October 2014, and found that the Remove button was grayed out. This was a bug with Apple’s system: the iTunes rule is that “computers and devices can be associated with a different Apple ID once every 90 days,” but my iPhone was in continuous use for 10 months. I had to contact iTunes customer support to get the iPhone manually removed from my account. Three emails and two phone contacts later, it wasn’t 100% resolved, so hopefully your Remove button works properly.
 Apple ID: Manage Trusted Devices. Yes, there is yet another place where your iPhone may be linked to an account online: Apple’s identify verification web site at AppleID.apple.com. Once you log into your account, which may be protected with two-factor identification — a password on your Mac, then another one-time password sent to your choice of “trusted devices” — you can click on Password and Security to “Manage your trusted devices” by hitting the “Add or Remove Trusted Devices” button. Your old iPhone will probably be on this list, and you can remove it by hitting the “Remove” button. This will prevent your iPhone from acting as a device to verify your identity for any two-factor authentication process.
 Remove The SIM Card. If you’ve gone through everything above, you’ve done pretty much everything necessary to scrub your iPhone’s onboard data, cloud associations, and carrier contract before resale. There are only a few final physical steps to get it ready to send out to someone. The most critical is to remove your SIM card from the iPhone by using either Apple’s included SIM card tool or a paperclip to pop the side compartment open. Place the card in a safe place for transfer to your next phone.
 Physical Cleanliness. It would be nice (and likely maximize your trade-in/resale price) to have your iPhone looking as close to new as possible. You can use two lightly dampened microfiber cloths to clean the visible exterior surfaces, first gently removing any crusted-on debris, then wiping the glass and metal or plastic down softly. Don’t get the cloths near speaker, microphone, or accessory port holes; leave them alone. After that’s done, assemble the iPhone’s pack-ins, such as its earphones and/or earphone case, wall charger, and USB cable, preferably with the original box. If they’re looking good, you can take photos and list your iPhone on eBay, or skip the photos and sell your iPhone to a company such as Gazelle.