Yep.
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
orapplicationDidReceiveMemoryWarning:
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.
-
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
If you use Carthage to manage your dependencies:
- Simply add AllYourMemoriesAreBelong2iOS to your
Cartfile
:
github "TorinKwok/AllYourMemoriesAreBelong2iOS" ~> 1.0.3
-
Click
File
->Add Files to "$PROJECT_NAME"
item in Xcode menu bar. Choose theAllYourMemoriesAreBelong2iOS.xcodeproj
-
Embed AllYourMemoriesAreBelong2iOS in
General
panel
To install using CocoaPods, add the following to your project Podfile:
pod 'AllYourMemoriesAreBelong2iOS', '~>1.0.3'
- Clone and incorporate this repo into your project with
git submodule
command:
git submodule add https://github.com/TorinKwok/AllYourMemoriesAreBelong2iOS.git "$SRC_ROOT" --recursive`
- The remaining steps are identical to the last two in Carthage section
-
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
-
Press physical volume buttons on your iOS devices to induce the system memory warnings. You will want to process those notifications in
didReceiveMemoryWarning
orapplicationDidReceiveMemoryWarning:
method in the ViewControllers or AppDelegate
Torin Kwok.
- Email:
dG9yaW5Aa3dvay5pbQ==
(base64ed) - OpenPGP/GnuPG: fetch pub key
- GitHub: @TorinKwok
MIT.