summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md258
1 files changed, 258 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..ac49f5d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,258 @@
1# libirecovery
2
3*The libirecovery library allows communication with iBoot/iBSS of iOS devices
4via USB.*
5
6![](https://github.com/libimobiledevice/libirecovery/workflows/build/badge.svg)
7
8## Table of Contents
9- [Features](#features)
10- [Building](#building)
11 - [Prerequisites](#prerequisites)
12 - [Linux (Debian/Ubuntu based)](#linux-debianubuntu-based)
13 - [macOS](#macos)
14 - [Windows](#windows)
15 - [Configuring the source tree](#configuring-the-source-tree)
16 - [Building and installation](#building-and-installation)
17- [Usage](#usage)
18- [Contributing](#contributing)
19- [Links](#links)
20- [License](#license)
21- [Credits](#credits)
22
23## Features
24
25libirecovery is a cross-platform library which implements communication to
26iBoot/iBSS found on Apple's iOS devices via USB. A command-line utility named
27`irecovery` is also provided.
28
29This is a fork of an older version from former openjailbreak.org and is meant to
30be used with [idevicerestore](https://github.com/libimobiledevice/idevicerestore.git/) from the [libimobiledevice](https://github.com/libimobiledevice/) project.
31
32## Building
33
34### Prerequisites
35
36You need to have a working compiler (gcc/clang) and development environent
37available. This project uses autotools for the build process, allowing to
38have common build steps across different platforms.
39Only the prerequisites differ and they are described in this section.
40
41libirecovery requires [libimobiledevice-glue](https://github.com/libimobiledevice/libimobiledevice-glue).
42Check the [Building](https://github.com/libimobiledevice/libimobiledevice-glue?tab=readme-ov-file#building)
43section of the README on how to build it. Note that some platforms might have it as a package.
44
45#### Linux (Debian/Ubuntu based)
46
47* Install all required dependencies and build tools:
48 ```shell
49 sudo apt-get install \
50 build-essential \
51 pkg-config \
52 checkinstall \
53 git \
54 autoconf \
55 automake \
56 libtool-bin \
57 libimobiledevice-glue-dev \
58 libreadline-dev \
59 libusb-1.0-0-dev
60 ```
61
62 In case libimobiledevice-glue-dev is not available, you can manually build and install it. See note above.
63
64#### macOS
65
66* Make sure the Xcode command line tools are installed. Then, use either [MacPorts](https://www.macports.org/)
67 or [Homebrew](https://brew.sh/) to install `automake`, `autoconf`, `libtool`, etc.
68
69 Using MacPorts:
70 ```shell
71 sudo port install libtool autoconf automake pkgconfig
72 ```
73
74 Using Homebrew:
75 ```shell
76 brew install libtool autoconf automake pkg-config
77 ```
78
79#### Windows
80
81* Using [MSYS2](https://www.msys2.org/) is the official way of compiling this project on Windows. Download the MSYS2 installer
82 and follow the installation steps.
83
84 It is recommended to use the _MSYS2 MinGW 64-bit_ shell. Run it and make sure the required dependencies are installed:
85
86 ```shell
87 pacman -S base-devel \
88 git \
89 mingw-w64-x86_64-gcc \
90 make \
91 libtool \
92 autoconf \
93 automake-wrapper \
94 pkg-config
95 ```
96 NOTE: You can use a different shell and different compiler according to your needs. Adapt the above command accordingly.
97
98### Configuring the source tree
99
100You can build the source code from a git checkout, or from a `.tar.bz2` release tarball from [Releases](https://github.com/libimobiledevice/libirecovery/releases).
101Before we can build it, the source tree has to be configured for building. The steps depend on where you got the source from.
102
103Since libirecovery depends on other packages, you should set the pkg-config environment variable `PKG_CONFIG_PATH`
104accordingly. Make sure to use a path with the same prefix as the dependencies. If they are installed in `/usr/local` you would do
105
106```shell
107export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
108```
109
110* **From git**
111
112 If you haven't done already, clone the actual project repository and change into the directory.
113 ```shell
114 git clone https://github.com/libimobiledevice/libirecovery
115 cd libirecovery
116 ```
117
118 Configure the source tree for building:
119 ```shell
120 ./autogen.sh
121 ```
122
123* **From release tarball (.tar.bz2)**
124
125 When using an official [release tarball](https://github.com/libimobiledevice/libirecovery/releases) (`libirecovery-x.y.z.tar.bz2`)
126 the procedure is slightly different.
127
128 Extract the tarball:
129 ```shell
130 tar xjf libirecovery-x.y.z.tar.bz2
131 cd libirecovery-x.y.z
132 ```
133
134 Configure the source tree for building:
135 ```shell
136 ./configure
137 ```
138
139Both `./configure` and `./autogen.sh` (which generates and calls `configure`) accept a few options, for example `--prefix` to allow
140building for a different target folder. You can simply pass them like this:
141
142```shell
143./autogen.sh --prefix=/usr/local
144```
145or
146```shell
147./configure --prefix=/usr/local
148```
149
150Once the command is successful, the last few lines of output will look like this:
151```
152[...]
153config.status: creating config.h
154config.status: executing depfiles commands
155config.status: executing libtool commands
156
157Configuration for libirecovery 1.2.0:
158-------------------------------------------
159
160 Install prefix: .........: /usr/local
161 USB backend: ............: IOKit
162
163 Now type 'make' to build libirecovery 1.2.0,
164 and then 'make install' for installation.
165```
166
167### Building and installation
168
169If you followed all the steps successfully, and `autogen.sh` or `configure` did not print any errors,
170you are ready to build the project. This is simply done with
171
172```shell
173make
174```
175
176If no errors are emitted you are ready for installation. Depending on whether
177the current user has permissions to write to the destination directory or not,
178you would either run
179```shell
180make install
181```
182_OR_
183```shell
184sudo make install
185```
186
187If you are on Linux, you want to run `sudo ldconfig` after installation to
188make sure the installed libraries are made available.
189
190## Usage
191
192First of all attach your device to your machine. Make sure your device is not
193in normal mode. You can use the `ideviceenterrecovery` application from
194[libimobiledevice](https://github.com/libimobiledevice/libimobiledevice.git/)
195to let your device boot into recovery mode if you need it.
196
197Then simply run:
198```shell
199irecovery --shell
200```
201
202This connects to your device and opens a simple shell to interact with the
203device.
204
205For instance to make your device boot into normal mode again use:
206```shell
207setenv auto-boot true
208saveenv
209reboot
210```
211
212Please consult the usage information or manual page for a full documentation of
213available command line options:
214```shell
215irecovery --help
216man irecovery
217```
218
219## Contributing
220
221We welcome contributions from anyone and are grateful for every pull request!
222
223If you'd like to contribute, please fork the `master` branch, change, commit and
224send a pull request for review. Once approved it can be merged into the main
225code base.
226
227If you plan to contribute larger changes or a major refactoring, please create a
228ticket first to discuss the idea upfront to ensure less effort for everyone.
229
230Please make sure your contribution adheres to:
231* Try to follow the code style of the project
232* Commit messages should describe the change well without being too short
233* Try to split larger changes into individual commits of a common domain
234* Use your real name and a valid email address for your commits
235
236## Links
237
238* Homepage: https://libimobiledevice.org/
239* Repository: https://git.libimobiledevice.org/libirecovery.git
240* Repository (Mirror): https://github.com/libimobiledevice/libirecovery.git
241* Issue Tracker: https://github.com/libimobiledevice/libirecovery/issues
242* Mailing List: https://lists.libimobiledevice.org/mailman/listinfo/libimobiledevice-devel
243* Twitter: https://twitter.com/libimobiledev
244
245## License
246
247This project is licensed under the [GNU Lesser General Public License v2.1](https://www.gnu.org/licenses/lgpl-2.1.en.html),
248also included in the repository in the `COPYING` file.
249
250## Credits
251
252Apple, iPhone, iPad, iPod, iPod Touch, Apple TV, Apple Watch, Mac, iOS,
253iPadOS, tvOS, watchOS, and macOS are trademarks of Apple Inc.
254
255This project is an independent software library and has not been authorized,
256sponsored, or otherwise approved by Apple Inc.
257
258README Updated on: 2024-03-23