Bug 12104 - Don't allow the device to sleep when the debugger is attached
Summary: Don't allow the device to sleep when the debugger is attached
Alias: None
Product: iOS
Classification: Xamarin
Component: Debugger ()
Version: XI 10.4 (C9)
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2013-05-05 22:45 UTC by Felipe Cypriano
Modified: 2017-09-19 11:53 UTC (History)
6 users (show)

Tags: papercut
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 12104 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Felipe Cypriano 2013-05-05 22:45:18 UTC
When debugging an app on the iOS Device it shouldn't be allowed to automatically sleep when the debugger is attached, just like when debugging from Xcode and from AppCode.
Comment 1 Sebastien Pouliot 2013-05-08 13:22:01 UTC
We could automagically call [1]

	UIApplication.SharedApplication.IdleTimerDisabled = true;

on debug builds. The (small) drawback is that you can't debug (well test) code that's called when the application goes to (or from) sleep.

OTOH you can also add it directly inside your `FinishedLaunching` override.

	UIApplication.SharedApplication.IdleTimerDisabled = true;

[1] http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html
Comment 2 Felipe Cypriano 2013-05-08 18:55:38 UTC
I printed out in the ViewDidAppear of my first ViewController the value of IdleTimerDisabled when running a app on the device using Xcode and AppCode. Both returned false.

I think they don't use this approach to keep the device from sleep.
Comment 4 Vincent Dondain [MSFT] 2017-04-24 02:48:08 UTC
We acknowledge this enhancement request, therefore marked it as CONFIRMED.
However this does not necessarily mean we will take actions on it as we still need to discuss its feasibility internally and make sure it is not conflicting with other features.