Skip to content

Commit

Permalink
tools: Add afcclient utility
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Dec 30, 2023
1 parent 76f924c commit 7f781eb
Show file tree
Hide file tree
Showing 4 changed files with 1,393 additions and 1 deletion.
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ LT_INIT
PKG_CHECK_MODULES(libusbmuxd, libusbmuxd-2.0 >= $LIBUSBMUXD_VERSION)
PKG_CHECK_MODULES(libplist, libplist-2.0 >= $LIBPLIST_VERSION)
PKG_CHECK_MODULES(limd_glue, libimobiledevice-glue-1.0 >= $LIMD_GLUE_VERSION)
AC_ARG_WITH([readline],
[AS_HELP_STRING([--without-readline],
[build without support for libreadline (default is yes)])],
[check_libreadline=false],
[check_libreadline=true])
if test "$check_libreadline" = "true"; then
PKG_CHECK_MODULES(readline, readline >= 1.0, have_readline=yes, have_readline=no)
if test "x$have_readline" = "xyes"; then
AC_DEFINE(HAVE_READLINE, 1, [Define if readline library is available])
fi
fi
AM_CONDITIONAL([HAVE_READLINE],[test "x$have_readline" = "xyes"])

# Checks for header files.
AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h])
Expand Down
76 changes: 76 additions & 0 deletions docs/afcclient.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.TH "afcclient" 1
.SH NAME
afcclient \- Interact with AFC/HouseArrest service on a connected device.
.SH SYNOPSIS
.B afcclient
[OPTIONS] [COMMAND ...]

.SH DESCRIPTION

Utility to interact with AFC/HouseArrest service. This allows access to parts
of the filesystem on an iOS device.

\f[B]afcclient\f[] can be used interactively with a command prompt, or run a single command and exit.

.SH COMMANDS
.TP
.B devinfo
print device information
.TP
.B info PATH
print file attributes of file at PATH
.TP
.B ls PATH
print directory contents of PATH
.TP
.B mv OLD NEW
rename file OLD to NEW
.TP
.B mkdir PATH
create directory at PATH
.TP
.B ln [-s] FILE [LINK]
Create a (symbolic) link to file named LINKNAME. \f[B]NOTE: This feature has been disabled in newer versions of iOS\f[].
.TP
.B rm PATH
remove item at PATH
.TP
.B get PATH [LOCALPATH]
transfer file at PATH from device to LOCALPATH, or current directory if omitted. If LOCALPATH is a directory, the file will be stored inside the directory.
\f[B]WARNING\f[]: Existing files will be overwritten!
.TP
.B put LOCALPATH [PATH]
transfer local file at LOCALPATH to device at PATH, or current directory if omitted. If PATH is a directory, the file will be stored inside the directory.
\f[B]WARNING\f[]: Existing files will be overwritten!
.TP

.SH OPTIONS
.TP
.B \-u, \-\-udid UDID
target specific device by UDID
.TP
.B \-n, \-\-network
connect to network device (not recommended, since the connection might be terminated at any time)
.TP
.B \--container <appid>
Access the app container directory of the app with given \f[B]appid\f[]
.TP
.B \--documents <appid>
Access the Documents directory of the app with given \f[B]appid\f[]
.TP
.B \-h, \-\-help
Prints usage information
.TP
.B \-d, \-\-debug
Enable communication debugging
.TP
.B \-v, \-\-version
Prints version information

.SH AUTHOR
Nikias Bassen

.SH ON THE WEB
https://libimobiledevice.org

https://github.com/libimobiledevice/libimobiledevice
12 changes: 11 additions & 1 deletion tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ bin_PROGRAMS = \
idevicedevmodectl \
idevicenotificationproxy \
idevicecrashreport \
idevicesetlocation
idevicesetlocation \
afcclient

idevicebtlogger_SOURCES = idevicebtlogger.c
iidevicebtlogger_CFLAGS = $(AM_CFLAGS)
Expand Down Expand Up @@ -132,3 +133,12 @@ idevicesetlocation_SOURCES = idevicesetlocation.c
idevicesetlocation_CFLAGS = $(AM_CFLAGS)
idevicesetlocation_LDFLAGS = $(AM_LDFLAGS)
idevicesetlocation_LDADD = $(top_builddir)/src/libimobiledevice-1.0.la

afcclient_SOURCES = afcclient.c
afcclient_CFLAGS = $(AM_CFLAGS)
afcclient_LDFLAGS = $(AM_LDFLAGS)
if HAVE_READLINE
afcclient_CFLAGS += $(readline_CFLAGS)
afcclient_LDFLAGS += $(readline_LIBS)
endif
afcclient_LDADD = $(top_builddir)/src/libimobiledevice-1.0.la $(limd_glue_LIBS)
Loading

0 comments on commit 7f781eb

Please sign in to comment.