The utility of a smartphone is limited by its battery capacity and the ability of its hardware and software to efficiently use the device’s battery. To properly characterize the energy consumption of an app and identify energy defects, it is critical that apps are properly tested, i.e., analyzed dynamically to assess the app’s energy properties. However, currently there is a lack of testing tools for evaluating the energy properties of apps. In this paper, we present COBWEB, a search-based energy testing technique for Android. By leveraging a set of novel models, which represent lifecycle state of an app and hardware states on the phone, COBWEB generates a test suite that can effectively find energy defects. Our experimental results using real-world apps demonstrate not only its ability to effectively and efficiently test energy behavior of apps, but also its superiority over the state-of-the-art Android testing techniques by finding a wider and more diverse set of energy defects.