• Home
  • API Documentation
Show / Hide Table of Contents
  • iMobileDevice
    • ILibiMobileDevice
    • LibiMobileDevice
    • NativeLibraries
    • NativeStringArrayMarshaler
    • NativeStringMarshaler
    • Utf8Marshal
  • iMobileDevice.Afc
    • AfcApi
    • AfcClientHandle
    • AfcClientHandleDelegateMarshaler
    • AfcDictionaryMarshaler
    • AfcError
    • AfcErrorExtensions
    • AfcException
    • AfcFileMode
    • AfcLinkType
    • AfcLockOp
    • AfcNativeMethods
    • IAfcApi
  • iMobileDevice.DebugServer
    • DebugServerApi
    • DebugServerClientHandle
    • DebugServerClientHandleDelegateMarshaler
    • DebugServerCommandHandle
    • DebugServerCommandHandleDelegateMarshaler
    • DebugServerError
    • DebugServerErrorExtensions
    • DebugServerException
    • DebugServerNativeMethods
    • IDebugServerApi
  • iMobileDevice.DiagnosticsRelay
    • DiagnosticsRelayAction
    • DiagnosticsRelayApi
    • DiagnosticsRelayClientHandle
    • DiagnosticsRelayClientHandleDelegateMarshaler
    • DiagnosticsRelayError
    • DiagnosticsRelayErrorExtensions
    • DiagnosticsRelayException
    • DiagnosticsRelayNativeMethods
    • IDiagnosticsRelayApi
  • iMobileDevice.FileRelay
    • FileRelayApi
    • FileRelayClientHandle
    • FileRelayClientHandleDelegateMarshaler
    • FileRelayError
    • FileRelayErrorExtensions
    • FileRelayException
    • FileRelayNativeMethods
    • IFileRelayApi
  • iMobileDevice.HeartBeat
    • HeartBeatApi
    • HeartBeatClientHandle
    • HeartBeatClientHandleDelegateMarshaler
    • HeartBeatError
    • HeartBeatErrorExtensions
    • HeartBeatException
    • HeartBeatNativeMethods
    • IHeartBeatApi
  • iMobileDevice.HouseArrest
    • HouseArrestApi
    • HouseArrestClientHandle
    • HouseArrestClientHandleDelegateMarshaler
    • HouseArrestError
    • HouseArrestErrorExtensions
    • HouseArrestException
    • HouseArrestNativeMethods
    • IHouseArrestApi
  • iMobileDevice.iDevice
    • iDeviceApi
    • iDeviceConnectionHandle
    • iDeviceConnectionHandleDelegateMarshaler
    • iDeviceDebugCallBack
    • iDeviceError
    • iDeviceErrorExtensions
    • iDeviceEvent
    • iDeviceEventCallBack
    • iDeviceEventType
    • iDeviceException
    • iDeviceHandle
    • iDeviceHandleDelegateMarshaler
    • iDeviceListMarshaler
    • iDeviceNativeMethods
    • iDeviceSocketType
    • IiDeviceApi
  • iMobileDevice.InstallationProxy
    • IInstallationProxyApi
    • InstallationProxyApi
    • InstallationProxyClientHandle
    • InstallationProxyClientHandleDelegateMarshaler
    • InstallationProxyError
    • InstallationProxyErrorExtensions
    • InstallationProxyException
    • InstallationProxyNativeMethods
    • InstallationProxyStatusCallBack
  • iMobileDevice.Lockdown
    • ILockdownApi
    • LockdownApi
    • LockdownClientHandle
    • LockdownClientHandleDelegateMarshaler
    • LockdownError
    • LockdownErrorExtensions
    • LockdownException
    • LockdownMarshaler
    • LockdownNativeMethods
    • LockdownPairRecord
    • LockdownPairRecordHandle
    • LockdownPairRecordHandleDelegateMarshaler
    • LockdownServiceDescriptor
    • LockdownServiceDescriptorHandle
    • LockdownServiceDescriptorHandleDelegateMarshaler
  • iMobileDevice.Misagent
    • IMisagentApi
    • MisagentApi
    • MisagentClientHandle
    • MisagentClientHandleDelegateMarshaler
    • MisagentError
    • MisagentErrorExtensions
    • MisagentException
    • MisagentNativeMethods
  • iMobileDevice.Mobileactivation
    • IMobileactivationApi
    • MobileactivationApi
    • MobileactivationClientHandle
    • MobileactivationClientHandleDelegateMarshaler
    • MobileactivationError
    • MobileactivationErrorExtensions
    • MobileactivationException
    • MobileactivationNativeMethods
  • iMobileDevice.MobileBackup
    • IMobileBackupApi
    • MobileBackupApi
    • MobileBackupClientHandle
    • MobileBackupClientHandleDelegateMarshaler
    • MobileBackupError
    • MobileBackupErrorExtensions
    • MobileBackupException
    • MobileBackupFlags
    • MobileBackupNativeMethods
  • iMobileDevice.MobileBackup2
    • IMobileBackup2Api
    • MobileBackup2Api
    • MobileBackup2ClientHandle
    • MobileBackup2ClientHandleDelegateMarshaler
    • MobileBackup2Error
    • MobileBackup2ErrorExtensions
    • MobileBackup2Exception
    • MobileBackup2NativeMethods
  • iMobileDevice.MobileImageMounter
    • IMobileImageMounterApi
    • MobileImageMounterApi
    • MobileImageMounterClientHandle
    • MobileImageMounterClientHandleDelegateMarshaler
    • MobileImageMounterError
    • MobileImageMounterErrorExtensions
    • MobileImageMounterException
    • MobileImageMounterNativeMethods
    • MobileImageMounterUploadCallBack
  • iMobileDevice.MobileSync
    • IMobileSyncApi
    • MobileSyncAnchors
    • MobileSyncAnchorsHandle
    • MobileSyncAnchorsHandleDelegateMarshaler
    • MobileSyncApi
    • MobileSyncClientHandle
    • MobileSyncClientHandleDelegateMarshaler
    • MobileSyncError
    • MobileSyncErrorExtensions
    • MobileSyncException
    • MobileSyncNativeMethods
    • MobileSyncSyncType
  • iMobileDevice.NotificationProxy
    • INotificationProxyApi
    • NotificationProxyApi
    • NotificationProxyClientHandle
    • NotificationProxyClientHandleDelegateMarshaler
    • NotificationProxyError
    • NotificationProxyErrorExtensions
    • NotificationProxyException
    • NotificationProxyNativeMethods
    • NotificationProxyNotifyCallBack
  • iMobileDevice.Pinvoke
    • IPinvokeApi
    • PinvokeApi
    • PinvokeError
    • PinvokeErrorExtensions
    • PinvokeException
    • PinvokeNativeMethods
  • iMobileDevice.Plist
    • IPlistApi
    • PlistApi
    • PlistDictIterHandle
    • PlistDictIterHandleDelegateMarshaler
    • PlistHandle
    • PlistHandleDelegateMarshaler
    • PlistNativeMethods
    • PlistType
  • iMobileDevice.PropertyListService
    • IPropertyListServiceApi
    • PropertyListServiceApi
    • PropertyListServiceClientHandle
    • PropertyListServiceClientHandleDelegateMarshaler
    • PropertyListServiceError
    • PropertyListServiceErrorExtensions
    • PropertyListServiceException
    • PropertyListServiceNativeMethods
  • iMobileDevice.Restore
    • IRestoreApi
    • RestoreApi
    • RestoreClientHandle
    • RestoreClientHandleDelegateMarshaler
    • RestoreError
    • RestoreErrorExtensions
    • RestoreException
    • RestoreNativeMethods
  • iMobileDevice.Screenshotr
    • IScreenshotrApi
    • ScreenshotrApi
    • ScreenshotrClientHandle
    • ScreenshotrClientHandleDelegateMarshaler
    • ScreenshotrError
    • ScreenshotrErrorExtensions
    • ScreenshotrException
    • ScreenshotrNativeMethods
  • iMobileDevice.Service
    • ConstructorFunc
    • IServiceApi
    • ServiceApi
    • ServiceClientHandle
    • ServiceClientHandleDelegateMarshaler
    • ServiceError
    • ServiceErrorExtensions
    • ServiceException
    • ServiceNativeMethods
  • iMobileDevice.SpringBoardServices
    • ISpringBoardServicesApi
    • SpringBoardServicesApi
    • SpringBoardServicesClientHandle
    • SpringBoardServicesClientHandleDelegateMarshaler
    • SpringBoardServicesError
    • SpringBoardServicesErrorExtensions
    • SpringBoardServicesException
    • SpringBoardServicesInterfaceOrientation
    • SpringBoardServicesNativeMethods
  • iMobileDevice.SyslogRelay
    • ISyslogRelayApi
    • SyslogRelayApi
    • SyslogRelayClientHandle
    • SyslogRelayClientHandleDelegateMarshaler
    • SyslogRelayError
    • SyslogRelayErrorExtensions
    • SyslogRelayException
    • SyslogRelayNativeMethods
    • SyslogRelayReceiveCallBack
  • iMobileDevice.Usbmuxd
    • IUsbmuxdApi
    • UsbmuxdApi
    • UsbmuxdDeviceInfo
    • UsbmuxdEvent
    • UsbmuxdEventCallBack
    • UsbmuxdEventType
    • UsbmuxdNativeMethods
    • UsbmuxdSocketType
  • iMobileDevice.WebInspector
    • IWebInspectorApi
    • WebInspectorApi
    • WebInspectorClientHandle
    • WebInspectorClientHandleDelegateMarshaler
    • WebInspectorError
    • WebInspectorErrorExtensions
    • WebInspectorException
    • WebInspectorNativeMethods

Class AfcApi

Inheritance
System.Object
AfcApi
Implements
IAfcApi
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: iMobileDevice.Afc
Assembly: iMobileDevice-net.dll
Syntax
public class AfcApi : IAfcApi

Constructors

| Improve this Doc View Source

AfcApi(ILibiMobileDevice)

Declaration
public AfcApi(ILibiMobileDevice parent)
Parameters
Type Name Description
ILibiMobileDevice parent

Properties

| Improve this Doc View Source

Parent

Declaration
public ILibiMobileDevice Parent { get; }
Property Value
Type Description
ILibiMobileDevice

Methods

| Improve this Doc View Source

afc_client_free(IntPtr)

Frees up an AFC client. If the connection was created by the client itself, the connection will be closed.

Declaration
public virtual AfcError afc_client_free(IntPtr client)
Parameters
Type Name Description
System.IntPtr client

The client to free.

Returns
Type Description
AfcError
| Improve this Doc View Source

afc_client_new(iDeviceHandle, LockdownServiceDescriptorHandle, out AfcClientHandle)

Makes a connection to the AFC service on the device.

Declaration
public virtual AfcError afc_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out AfcClientHandle client)
Parameters
Type Name Description
iDeviceHandle device

The device to connect to.

LockdownServiceDescriptorHandle service

The service descriptor returned by lockdownd_start_service.

AfcClientHandle client

Pointer that will be set to a newly allocated afc_client_t upon successful return.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success, AFC_E_INVALID_ARG if device or service is invalid, AFC_E_MUX_ERROR if the connection cannot be established, or AFC_E_NO_MEM if there is a memory allocation problem.

| Improve this Doc View Source

afc_client_start_service(iDeviceHandle, out AfcClientHandle, String)

Starts a new AFC service on the specified device and connects to it.

Declaration
public virtual AfcError afc_client_start_service(iDeviceHandle device, out AfcClientHandle client, string label)
Parameters
Type Name Description
iDeviceHandle device

The device to connect to.

AfcClientHandle client

Pointer that will point to a newly allocated afc_client_t upon successful return. Must be freed using afc_client_free() after use.

System.String label

The label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success, or an AFC_E_* error code otherwise.

| Improve this Doc View Source

afc_dictionary_free(IntPtr)

Frees up a char dictionary as returned by some AFC functions.

Declaration
public virtual AfcError afc_dictionary_free(IntPtr dictionary)
Parameters
Type Name Description
System.IntPtr dictionary

The char array terminated by an empty string.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_file_close(AfcClientHandle, UInt64)

Closes a file on the device.

Declaration
public virtual AfcError afc_file_close(AfcClientHandle client, ulong handle)
Parameters
Type Name Description
AfcClientHandle client

The client to close the file with.

System.UInt64 handle

File handle of a previously opened file.

Returns
Type Description
AfcError
| Improve this Doc View Source

afc_file_lock(AfcClientHandle, UInt64, AfcLockOp)

Locks or unlocks a file on the device. Makes use of flock on the device.

Declaration
public virtual AfcError afc_file_lock(AfcClientHandle client, ulong handle, AfcLockOp operation)
Parameters
Type Name Description
AfcClientHandle client

The client to lock the file with.

System.UInt64 handle

File handle of a previously opened file.

AfcLockOp operation

the lock or unlock operation to perform, this is one of AFC_LOCK_SH (shared lock), AFC_LOCK_EX (exclusive lock), or AFC_LOCK_UN (unlock).

Returns
Type Description
AfcError
| Improve this Doc View Source

afc_file_open(AfcClientHandle, String, AfcFileMode, ref UInt64)

Opens a file on the device.

Declaration
public virtual AfcError afc_file_open(AfcClientHandle client, string filename, AfcFileMode fileMode, ref ulong handle)
Parameters
Type Name Description
AfcClientHandle client

The client to use to open the file.

System.String filename

The file to open. (must be a fully-qualified path)

AfcFileMode fileMode
System.UInt64 handle

Pointer to a uint64_t that will hold the handle of the file

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_file_read(AfcClientHandle, UInt64, Byte[], UInt32, ref UInt32)

Attempts to the read the given number of bytes from the given file.

Declaration
public virtual AfcError afc_file_read(AfcClientHandle client, ulong handle, byte[] data, uint length, ref uint bytesRead)
Parameters
Type Name Description
AfcClientHandle client

The relevant AFC client

System.UInt64 handle

File handle of a previously opened file

System.Byte[] data

The pointer to the memory region to store the read data

System.UInt32 length

The number of bytes to read

System.UInt32 bytesRead
Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_file_seek(AfcClientHandle, UInt64, Int64, Int32)

Seeks to a given position of a pre-opened file on the device.

Declaration
public virtual AfcError afc_file_seek(AfcClientHandle client, ulong handle, long offset, int whence)
Parameters
Type Name Description
AfcClientHandle client

The client to use to seek to the position.

System.UInt64 handle

File handle of a previously opened.

System.Int64 offset

Seek offset.

System.Int32 whence

Seeking direction, one of SEEK_SET, SEEK_CUR, or SEEK_END.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_file_tell(AfcClientHandle, UInt64, ref UInt64)

Returns current position in a pre-opened file on the device.

Declaration
public virtual AfcError afc_file_tell(AfcClientHandle client, ulong handle, ref ulong position)
Parameters
Type Name Description
AfcClientHandle client

The client to use.

System.UInt64 handle

File handle of a previously opened file.

System.UInt64 position

Position in bytes of indicator

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_file_truncate(AfcClientHandle, UInt64, UInt64)

Sets the size of a file on the device.

Declaration
public virtual AfcError afc_file_truncate(AfcClientHandle client, ulong handle, ulong newsize)
Parameters
Type Name Description
AfcClientHandle client

The client to use to set the file size.

System.UInt64 handle

File handle of a previously opened file.

System.UInt64 newsize

The size to set the file to.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

Remarks

This function is more akin to ftruncate than truncate, and truncate calls would have to open the file before calling this, sadly.

| Improve this Doc View Source

afc_file_write(AfcClientHandle, UInt64, Byte[], UInt32, ref UInt32)

Writes a given number of bytes to a file.

Declaration
public virtual AfcError afc_file_write(AfcClientHandle client, ulong handle, byte[] data, uint length, ref uint bytesWritten)
Parameters
Type Name Description
AfcClientHandle client

The client to use to write to the file.

System.UInt64 handle

File handle of previously opened file.

System.Byte[] data

The data to write to the file.

System.UInt32 length

How much data to write.

System.UInt32 bytesWritten
Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_get_device_info(AfcClientHandle, out ReadOnlyCollection<String>)

Get device information for a connected client. The device information returned is the device model as well as the free space, the total capacity and blocksize on the accessed disk partition.

Declaration
public virtual AfcError afc_get_device_info(AfcClientHandle client, out ReadOnlyCollection<string> deviceInformation)
Parameters
Type Name Description
AfcClientHandle client

The client to get device info for.

System.Collections.ObjectModel.ReadOnlyCollection<System.String> deviceInformation
Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_get_device_info_key(AfcClientHandle, String, out String)

Get a specific key of the device info list for a client connection. Known key values are: Model, FSTotalBytes, FSFreeBytes and FSBlockSize. This is a helper function for afc_get_device_info().

Declaration
public virtual AfcError afc_get_device_info_key(AfcClientHandle client, string key, out string value)
Parameters
Type Name Description
AfcClientHandle client

The client to get device info for.

System.String key

The key to get the value of.

System.String value

The value for the key if successful or NULL otherwise.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_get_file_info(AfcClientHandle, String, out ReadOnlyCollection<String>)

Gets information about a specific file.

Declaration
public virtual AfcError afc_get_file_info(AfcClientHandle client, string filename, out ReadOnlyCollection<string> fileInformation)
Parameters
Type Name Description
AfcClientHandle client

The client to use to get the information of the file.

System.String filename

The fully-qualified path to the file.

System.Collections.ObjectModel.ReadOnlyCollection<System.String> fileInformation
Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_make_directory(AfcClientHandle, String)

Creates a directory on the device.

Declaration
public virtual AfcError afc_make_directory(AfcClientHandle client, string path)
Parameters
Type Name Description
AfcClientHandle client

The client to use to make a directory.

System.String path

The directory's path. (must be a fully-qualified path, I assume all other mkdir restrictions apply as well)

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_make_link(AfcClientHandle, AfcLinkType, String, String)

Creates a hard link or symbolic link on the device.

Declaration
public virtual AfcError afc_make_link(AfcClientHandle client, AfcLinkType linktype, string target, string linkname)
Parameters
Type Name Description
AfcClientHandle client

The client to use for making a link

AfcLinkType linktype

1 = hard link, 2 = symlink

System.String target

The file to be linked.

System.String linkname

The name of link.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_read_directory(AfcClientHandle, String, out ReadOnlyCollection<String>)

Gets a directory listing of the directory requested.

Declaration
public virtual AfcError afc_read_directory(AfcClientHandle client, string path, out ReadOnlyCollection<string> directoryInformation)
Parameters
Type Name Description
AfcClientHandle client

The client to get a directory listing from.

System.String path

The directory for listing. (must be a fully-qualified path)

System.Collections.ObjectModel.ReadOnlyCollection<System.String> directoryInformation
Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_remove_path(AfcClientHandle, String)

Deletes a file or directory.

Declaration
public virtual AfcError afc_remove_path(AfcClientHandle client, string path)
Parameters
Type Name Description
AfcClientHandle client

The client to use.

System.String path

The path to delete. (must be a fully-qualified path)

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_remove_path_and_contents(AfcClientHandle, String)

Deletes a file or directory including possible contents.

Declaration
public virtual AfcError afc_remove_path_and_contents(AfcClientHandle client, string path)
Parameters
Type Name Description
AfcClientHandle client

The client to use.

System.String path

The path to delete. (must be a fully-qualified path)

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

Remarks

Only available in iOS 6 and later.

| Improve this Doc View Source

afc_rename_path(AfcClientHandle, String, String)

Renames a file or directory on the device.

Declaration
public virtual AfcError afc_rename_path(AfcClientHandle client, string from, string to)
Parameters
Type Name Description
AfcClientHandle client

The client to have rename.

System.String from

The name to rename from. (must be a fully-qualified path)

System.String to

The new name. (must also be a fully-qualified path)

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_set_file_time(AfcClientHandle, String, UInt64)

Sets the modification time of a file on the device.

Declaration
public virtual AfcError afc_set_file_time(AfcClientHandle client, string path, ulong mtime)
Parameters
Type Name Description
AfcClientHandle client

The client to use to set the file size.

System.String path

Path of the file for which the modification time should be set.

System.UInt64 mtime

The modification time to set in nanoseconds since epoch.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

| Improve this Doc View Source

afc_truncate(AfcClientHandle, String, UInt64)

Sets the size of a file on the device without prior opening it.

Declaration
public virtual AfcError afc_truncate(AfcClientHandle client, string path, ulong newsize)
Parameters
Type Name Description
AfcClientHandle client

The client to use to set the file size.

System.String path

The path of the file to be truncated.

System.UInt64 newsize

The size to set the file to.

Returns
Type Description
AfcError

AFC_E_SUCCESS on success or an AFC_E_* error value.

Implements

IAfcApi
  • Improve this Doc
  • View Source
Back to top Copyright (c) 2015-2017 Quamotion bvba. All rights reserved