A simple CLI interface to AFC via libimobiledevice.
-
libimobiledevice (v 1.1.5+) (windows and mac libs included) https://github.com/libimobiledevice/libimobiledevice
-
if building for windows you will need mingw (http://mingw.org/wiki/Getting_Started)
The output is no longer fugly!
$ ./afcclient -r ls
d 27 864 Sep 24 13:00 .
d 2 64 Nov 14 17:09 .HFS+ Private Directory Data
f 1 0 Mar 14 05:25 .Trashes
d 2 64 Aug 29 00:14 .ba
f 1 0 Nov 03 15:03 .bootstrapped
f 1 0 Oct 02 19:38 .file
d 5 160 Jun 12 07:16 .fseventsd
d 2 64 Sep 29 20:28 .mb
f 1 0 Nov 03 15:03 .mount_rw
d 102 3264 Mar 08 18:31 Applications
d 8 340 May 27 00:25 Developer
d 26 832 Feb 28 12:24 Library
d 3 96 Sep 29 13:19 System
l 1 11 Sep 24 13:00 User -> /var/mobile
d 61 1952 Feb 28 12:22 bin
d 2 64 Oct 28 07:07 boot
d 2 64 Oct 02 19:38 cores
d 4 1707 Sep 24 13:00 dev
l 1 11 Mar 14 05:24 etc -> private/etc
d 2 64 Oct 28 07:07 lib
d 2 64 Oct 28 07:07 mnt
d 6 192 May 03 16:32 private
d 47 1504 Feb 03 00:55 sbin
l 1 15 Mar 14 05:25 tmp -> private/var/tmp
d 12 384 Nov 03 15:03 usr
l 1 11 Nov 14 17:20 var -> private/var
$ make
if you are using the included libraries for mac / windows you will need to copy them into the same location
as afcclient binary
Usage: afcclient [ra:u:vhlRc] command cmdargs...
Options:
-r, --root Use the afc2 server if jailbroken (ignored with -a)
-a, --appid=<APP-ID> Access bundle directory for app-id
-u, --uuid=<UDID> Specify the device udid
-v, --verbose Enable verbose debug messages
-h, --help Display this help message
-l, --list List devices
-R, --recursive List the specified folder recursively
-c, --clean Cleans out folder after exporting/cloning
New commands:
clone [path] [localpath] clone directory folder into a local folder. (requires path and localpath)\n"
clone [localpath] clone Documents folder into a local folder. (requires appid)
export [path] [localpath] export a specific directory to a local one (not recursive)
documents recursive plist formatted list of entire ~/Documents folder (requires appid)
Where "command" and "cmdargs..." are as folows:
devinfo dump device info from AFC server
ls <dir> [dir2...] list remote directory contents
info <path> [path2...] dump remote file information
mkdir <path> [path2...] create directory at path
rm <path> [path2...] remove directory at path
rename <from> <to> rename path 'from' to path 'to'
link <target> <link> create a hard-link from 'link' to 'target'
symlink <target> <link> create a symbolic-link from 'link' to 'target'
cat <path> cat contents of <path> to stdout
get <path> [localpath] download a file (default: current dir)
put <localpath> [path] upload a file (default: remote top-level dir)
- clean up the code
Eric Monti - esmonti at gmail dot com
tweaked by Kevin Bradley to remove clang requirement, include built libs for mac and windows (32 bit only for windows) and added some improved recursive listing functionality with plist output.
MIT - See LICENSE.txt