Coder Social home page Coder Social logo

deepsleep's Introduction

DeepSleep

A commandline tool for hibernating your Apple devices (macOS / tvOS / watchOS / iOS / iPadOS)

Why

  • Initially found a cool factory tool for it, thought it would help reserve battery to aid in preserving tetherboot longer.
  • It's very minimal code but an easy asset for beginners learning about IOKit
  • It's multiplatform (both iOS, watchOS, tvOS and macOS) and a commandline tool that didn't exist yet.
  • It was fun to reverse engineer a factory tool

How to use it

  • Turn on airplane mode so the device will not wake up by incoming calls or text messages
  • Turn off notifications in settings temporarily
  • Open a terminal or via ssh run deepsleep
  • Make sure to LEAVE YOUR DEVICE AT REST, because any button press or hardware interrupt (like USB) will wake it up again
  • Waking up is as easy as pressing any way of hardware input (buttons, USB, keyboard etc)

How to build it

  • Make sure you have the IOKit headers and libkern in your iOS SDK.
# To copy the required headers if you don't have them
sudo cp -r /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/IOKit.framework/Headers && sudo cp -r /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libkern
  • Run make in the directory of this repo.
  • If you're on macOS you can use the tool now. Even non-root users can execute it :)
  • If you're on iOS you'll have to codesign it: bash ldid -S deepsleep will do.
  • If you're on iOS you must elevate to root privileges for the command to work.

Contributions

  • You can contribute by writing settings panes, control center bundles or activator triggers to make entering deepsleep easier.

deepsleep's People

Contributors

userlandkernel avatar thebluekinglp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.