Interface IDebugServerApi
Namespace: iMobileDevice.DebugServer
Assembly: iMobileDevice-net.dll
Syntax
public interface IDebugServerApi
Properties
| Improve this Doc View SourceParent
Gets or sets the
Declaration
ILibiMobileDevice Parent { get; }
Property Value
Type | Description |
---|---|
ILibiMobileDevice |
Methods
| Improve this Doc View Sourcedebugserver_client_free(IntPtr)
Disconnects a debugserver client from the device and frees up the debugserver client data.
Declaration
DebugServerError debugserver_client_free(IntPtr client)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | client | The debugserver client to disconnect and free. |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client is NULL, or an DEBUGSERVER_E_* error code otherwise. |
debugserver_client_new(iDeviceHandle, LockdownServiceDescriptorHandle, out DebugServerClientHandle)
Connects to the debugserver service on the specified device.
Declaration
DebugServerError debugserver_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out DebugServerClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
LockdownServiceDescriptorHandle | service | The service descriptor returned by lockdownd_start_service. |
DebugServerClientHandle | client | Pointer that will point to a newly allocated debugserver_client_t upon successful return. Must be freed using debugserver_client_free() after use. |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client is NULL, or an DEBUGSERVER_E_* error code otherwise. |
debugserver_client_receive(DebugServerClientHandle, Byte[], UInt32, ref UInt32)
Receives raw data from the debugserver service.
Declaration
DebugServerError debugserver_client_receive(DebugServerClientHandle client, byte[] data, uint size, ref uint received)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client |
System.Byte[] | data | Buffer that will be filled with the data received |
System.UInt32 | size | Number of bytes to receive |
System.UInt32 | received | Number of bytes received (can be NULL to ignore) |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client or plist is NULL |
Remarks
The default read timeout is 10 seconds.
debugserver_client_receive_response(DebugServerClientHandle, out String)
Receives and parses response of debugserver service.
Declaration
DebugServerError debugserver_client_receive_response(DebugServerClientHandle client, out string response)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client |
System.String | response | Response received for last command (can be NULL to ignore) |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client is NULL |
debugserver_client_receive_with_timeout(DebugServerClientHandle, Byte[], UInt32, ref UInt32, UInt32)
Receives raw data using the given debugserver client with specified timeout.
Declaration
DebugServerError debugserver_client_receive_with_timeout(DebugServerClientHandle client, byte[] data, uint size, ref uint received, uint timeout)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client to use for receiving |
System.Byte[] | data | Buffer that will be filled with the data received |
System.UInt32 | size | Number of bytes to receive |
System.UInt32 | received | Number of bytes received (can be NULL to ignore) |
System.UInt32 | timeout | Maximum time in milliseconds to wait for data. |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when one or more parameters are invalid, DEBUGSERVER_E_MUX_ERROR when a communication error occurs, or DEBUGSERVER_E_UNKNOWN_ERROR when an unspecified error occurs. |
debugserver_client_send(DebugServerClientHandle, Byte[], UInt32, ref UInt32)
Sends raw data using the given debugserver service client.
Declaration
DebugServerError debugserver_client_send(DebugServerClientHandle client, byte[] data, uint size, ref uint sent)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client to use for sending |
System.Byte[] | data | Data to send |
System.UInt32 | size | Size of the data to send |
System.UInt32 | sent | Number of bytes sent (can be NULL to ignore) |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when one or more parameters are invalid, or DEBUGSERVER_E_UNKNOWN_ERROR when an unspecified error occurs. |
debugserver_client_send_command(DebugServerClientHandle, DebugServerCommandHandle, out String)
Sends a command to the debugserver service.
Declaration
DebugServerError debugserver_client_send_command(DebugServerClientHandle client, DebugServerCommandHandle command, out string response)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client |
DebugServerCommandHandle | command | Command to process and send |
System.String | response | Response received for the command (can be NULL to ignore) |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client or command is NULL |
debugserver_client_set_ack_mode(DebugServerClientHandle, Int32)
Controls status of ACK mode when sending commands or receiving responses.
Declaration
DebugServerError debugserver_client_set_ack_mode(DebugServerClientHandle client, int enabled)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client |
System.Int32 | enabled | A boolean flag indicating whether the internal ACK mode handling should be enabled or disabled. |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, or an DEBUGSERVER_E_* error code otherwise. |
debugserver_client_set_argv(DebugServerClientHandle, Int32, ReadOnlyCollection<String>, out String)
Sets the argv which launches an app.
Declaration
DebugServerError debugserver_client_set_argv(DebugServerClientHandle client, int argc, ReadOnlyCollection<string> argv, out string response)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client |
System.Int32 | argc | Number of arguments |
System.Collections.ObjectModel.ReadOnlyCollection<System.String> | argv | Array starting with the executable to be run followed by it's arguments |
System.String | response | Response received for the command (can be NULL to ignore) |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client is NULL |
debugserver_client_set_environment_hex_encoded(DebugServerClientHandle, String, out String)
Adds or sets an environment variable.
Declaration
DebugServerError debugserver_client_set_environment_hex_encoded(DebugServerClientHandle client, string env, out string response)
Parameters
Type | Name | Description |
---|---|---|
DebugServerClientHandle | client | The debugserver client |
System.String | env | The environment variable in "KEY=VALUE" notation |
System.String | response | Response received for the command (can be NULL to ignore) |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when client is NULL |
debugserver_client_start_service(iDeviceHandle, out DebugServerClientHandle, String)
Starts a new debugserver service on the specified device and connects to it.
Declaration
DebugServerError debugserver_client_start_service(iDeviceHandle device, out DebugServerClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
DebugServerClientHandle | client | Pointer that will point to a newly allocated debugserver_client_t upon successful return. Must be freed using debugserver_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 |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, or an DEBUGSERVER_E_* error code otherwise. |
debugserver_command_free(IntPtr)
Frees memory of command object.
Declaration
DebugServerError debugserver_command_free(IntPtr command)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | command | The command object |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when command is NULL |
debugserver_command_new(String, Int32, ReadOnlyCollection<String>, out DebugServerCommandHandle)
Creates and initializes a new command object.
Declaration
DebugServerError debugserver_command_new(string name, int argc, ReadOnlyCollection<string> argv, out DebugServerCommandHandle command)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the command which is sent in plain text |
System.Int32 | argc | Number of items in the token array |
System.Collections.ObjectModel.ReadOnlyCollection<System.String> | argv | Array of tokens for the command ment to be encoded |
DebugServerCommandHandle | command | New command object |
Returns
Type | Description |
---|---|
DebugServerError | DEBUGSERVER_E_SUCCESS on success, DEBUGSERVER_E_INVALID_ARG when name or command is NULL |
debugserver_decode_string(String, UInt32, out String)
Decodes a hex encoded string.
Declaration
void debugserver_decode_string(string encodedBuffer, uint encodedLength, out string buffer)
Parameters
Type | Name | Description |
---|---|---|
System.String | encodedBuffer | |
System.UInt32 | encodedLength | |
System.String | buffer | Decoded string to be freed by the caller |
debugserver_encode_string(String, out String, ref UInt32)
Encodes a string into hex notation.
Declaration
void debugserver_encode_string(string buffer, out string encodedBuffer, ref uint encodedLength)
Parameters
Type | Name | Description |
---|---|---|
System.String | buffer | String to encode into hex notiation |
System.String | encodedBuffer | |
System.UInt32 | encodedLength |