How can I simulate different types of load in an Android device?

To test the performance of your application you can use debug trace tools. And check out this How to test the performance of an Android application?

And also this link provides some tools to test application performance.

You can use some applications like this or you can write some app to do some stress testing with CPU and RAM.

How can i stress my phone's CPU programatically?


Your requirement is that you want to test the application under stressed or release condition which can be controlled by you. so here the solution which I can see is

  • You can develop one more application(background service mostly) which would be responsible for increasing or decreasing the CPU cycles, Occupying or Releasing Memory and keep the network busy by the network operation(make simple UI to give the inputs)

    1. CPU cycles : Create multiple threads which would do Float operations and consume lot many CPU cycles and can be keep on the sleep when not required

    2. Memory : Need to write the C code(malloc to allocate the memory to pointers) and access that through the JNI and function to release the same. use the memory function from java to monitor current usage

    3. Network : Make task to download huge amount of files from dropbox or other server when needed and monitor the state as required.

after this configuration run the service, launch the desired application and test out under that condition.