GithubHelp home page GithubHelp logo

davidmr001 / allyourmemoriesarebelong2ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from torinkwok/allyourmemoriesarebelong2ios

0.0 1.0 0.0 50 KB

Simulate iOS on-device memory warnings like a hero.

Home Page: http://bit.ly/AllYourMemoriesAreBelong2iOS

License: Other

Objective-C 100.00%

allyourmemoriesarebelong2ios's Introduction

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

  • It induces memory warnings through pressing the physical volume button on iOS devices

  • It works transparently. In other words, to use AllYourMemoriesAreBelong2iOS, you need just linking this framework into your app and hit the Run button to build and then run the Debug scheme. You will never be asked to configure anything and the debug codes in this framework will never be shipped in releasing version

  • It supports hot-swapability for KVOController from Facebook. In other words, if your app has linked KVOController.framework, the internal mechanism of AllYourMemoriesAreBelong2iOS would take advantage of it, otherwise the raw KVO API would be applied instead

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.

allyourmemoriesarebelong2ios's People

Contributors

torinkwok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.