Closed mykola-mokhnach closed 7 months ago
@KazuCocoa @Dan-Maor Could you please test this API with a real app that actually has the didReceiveMemoryWarning
defined?
I will give it a test tomorrow.
Are you sure this selector will simulate the memory warning on the app under test? From what I remember [UIApplication sharedApplication]
is the currently executed application, in this case it will be WebDriverAgent itself.
I will give it a test tomorrow. Are you sure this selector will simulate the memory warning on the app under test? From what I remember
[UIApplication sharedApplication]
is the currently executed application, in this case it will be WebDriverAgent itself.
I expect WDA to be in background, so sharedApplication returns the currently running/foreground app. This assumption needs to be confirmed though.
It will take more time to test. I'll test with tvOS as well. (will create a simple app with didReceiveMemoryWarning
and to test, maybe can be done in this week)
According to the documentation, [UIApplication sharedApplication]
is tied to the executing application's UIApplicationMain
, so it doesn't look like it's related to the application in the foreground.
https://developer.apple.com/documentation/uikit/uiapplication/1622975-sharedapplication
I've confirmed it by invoking applicationState
on the object, and the returned state is UIApplicationStateBackground
, meaning it is tied to the executing application (WDA) as I've suspected.
I wrote a quick app which handles applicationDidReceiveMemoryWarning
by just printing a log line, however calling the WDA command doesn't look like it has any effect on the app as the function is not invoked.
@Dan-Maor Thanks for checking it. I will try a different approach then
https://stackoverflow.com/questions/4717138/ios-development-how-can-i-induce-low-memory-warnings-on-device