All Your Memories Are Belong to iOS

Simulate iOS on-device memory warnings like a hero.

Download as .zip Download as .tar.gz View on GitHub

What's this

A frequently asked question on StackOverflow.net:

I'd like to test my app functions well in low memory conditions, but it's difficult to test. How can I induce low memory warnings that trigger the didReceiveMemoryWarning or applicationDidReceiveMemoryWarning: method in my ViewControllers or AppDelegate when the app is running on the real device, NOT the simulator? Or what are some ways I can test my app under these possible conditions?

The reason I can't use the simulator is my app uses Game Center and invites don't work on the simulator.

Okay, this tool simulates iOS on-device memory warnings like a hero.

Features

How to use

  1. Clone and incorporate this repo into your project with git submodule:

    git submodule add https://github.com/TorinKwok/AllYourMemoriesAreBelong2iOS.git ${YOUR_DIR} --recursive

  2. Hit File -> Add Files to "${YOUR_PROJECT_NAME}" item in Xcode menu bar, then choose the AllYourMemoriesAreBelong2iOS.xcodeproj

  3. Link AllYourMemoriesAreBelong2iOS in General panel

  4. Make sure build and run your project in Debug scheme. AllYourMemoriesAreBelong2iOS includes the invocation of Apple private API, its implementation was masked in releasing version as it will be rejected by Apple

  5. Press physical volume button on your iOS devices to induce the system memory warnings. You will want to process those notifications in didReceiveMemoryWarning or applicationDidReceiveMemoryWarning: method in the ViewControllers or AppDelegate

Author

Torin Kwok.

Contact me

License

Creative Commons License
AllYourMemoriesAreBelong2iOS by Torin Kwok is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.