Skip to content

torinkwok/AllYourMemoriesAreBelong2iOS

Repository files navigation

Broken English?

Yep.

What's this?

A kind of questions frequently asked on StackOverflow:

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.

AllYourMemoriesAreBelong2iOS is an elegant solution to those problems. With using it, it became incredibly easy to simulate iOS on-device memory warnings.

Carthage compatible pod-validablity-badge version-badge license-badge

Features

  • Induces memory warnings through simply pressing the physical volume buttons on iOS devices (like a hero)

  • Works transparently. To use AllYourMemoriesAreBelong2iOS, all you have to do is just to link this framework to your app and hit the Run button to build/run the Debug scheme. You would never be bothered configuring anything. Also, the debug codes within this framework would never be shipped in releasing version

  • Supports hot-swapability for facebook/KVOController. That is to say, once your app has linked to KVOController.framework, the internal mechanism of AllYourMemoriesAreBelong2iOS would take advantage of it automatically, otherwise the raw KVO API will be choosen instead

Installation

Carthage

If you use Carthage to manage your dependencies:

  1. Simply add AllYourMemoriesAreBelong2iOS to your Cartfile:
github "TorinKwok/AllYourMemoriesAreBelong2iOS" ~> 1.0.3
  1. Click File -> Add Files to "$PROJECT_NAME" item in Xcode menu bar. Choose the AllYourMemoriesAreBelong2iOS.xcodeproj

  2. Embed AllYourMemoriesAreBelong2iOS in General panel

CocoaPods

To install using CocoaPods, add the following to your project Podfile:

pod 'AllYourMemoriesAreBelong2iOS', '~>1.0.3'

Git Submodule

  1. Clone and incorporate this repo into your project with git submodule command:
git submodule add https://github.com/TorinKwok/AllYourMemoriesAreBelong2iOS.git "$SRC_ROOT" --recursive`
  1. The remaining steps are identical to the last two in Carthage section

Usage

  1. Make sure that your project is being built with the Debug scheme. Keep in mind that AllYourMemoriesAreBelong2iOS is impossible without invocations to Apple private APIs, hence its all internal implementation was masked in releasing version, since, if not so, there's a distinct possibility that your app would be rejected by iTunes Connect reviewers

  2. Press physical volume buttons 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

MIT.