Is there any way to simulate taking a screen shot on iOS simulator (equivalent of home + power on device)? My goal is NOT to save (cmd + s) or copy a shot of screen (from simulator menu items) but to capture UIApplicationUserDidTakeScreenshotNotification event.
Capturing device Screen − you can capture your Mac's screen from the area your simulator is running in. to do this you have to press, Command, shift and 4 at the same time, then drag to select the area you want to capture. Alternatively you can press 3 instead of 4 to capture the whole screen.
If you take a screenshot from within your app running on the simulator, and then save it to photos app on that simulator, then it is stored in some library folder of that specific Simulator.
How to simulate location in Simulator. To simulate location on a Simulator, select Features menu > Location, then you will see a list of location and movement options you can simulate.
Hold down the Option key. Move the circles that represent finger touches to the start position. Move the center of the pinch target by holding down the Shift key, moving the circles to the desired center position, and releasing the Shift key.
Use LLDB to mimic the screenshot NSNotification:
(lldb) expr [[NSNotificationCenter defaultCenter] postNotificationName:(NSNotificationName)UIApplicationUserDidTakeScreenshotNotification object:nil]
Pass --ignore-breakpoints false --
to the expr
command if you want to stop at a breakpoint too:
(lldb) expr --ignore-breakpoints false -- [[NSNotificationCenter defaultCenter] postNotificationName:(NSNotificationName)UIApplicationUserDidTakeScreenshotNotification object:nil]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With