Skip to content

Give user better errors message for lockdown errors like "Could not connect to lockdownd, error code -123" #49375

@jmagman

Description

@jmagman

Users get errors like:

ERROR: Could not connect to lockdownd, error code -18

when the tools can't connect to iOS devices, specifically various lockdown services.

Flutter tool checks for a -19 and -21 to make recovery suggestions:

/// Error code indicating that the pairing dialog has been shown to the user,
/// and the user has not yet responded as to whether to trust the host.
static const LockdownReturnCode pairingDialogResponsePending = LockdownReturnCode._(19);
/// Error code indicating that the host is not trusted.
///
/// This can happen if the user explicitly says "do not trust this computer"
/// or if they revoke all trusted computers in the device settings.
static const LockdownReturnCode invalidHostId = LockdownReturnCode._(21);

Some of the ones not checked for have obvious recovery suggestions, but it would be useful to give better error messages for all lockdown errors instead of just the error code, even when there are no obvious recovery suggestions.

typedef enum {
	/* custom */
	LOCKDOWN_E_SUCCESS                                 =   0,
	LOCKDOWN_E_INVALID_ARG                             =  -1,
	LOCKDOWN_E_INVALID_CONF                            =  -2,
	LOCKDOWN_E_PLIST_ERROR                             =  -3,
	LOCKDOWN_E_PAIRING_FAILED                          =  -4,
	LOCKDOWN_E_SSL_ERROR                               =  -5,
	LOCKDOWN_E_DICT_ERROR                              =  -6,
	LOCKDOWN_E_RECEIVE_TIMEOUT                         =  -7,
	LOCKDOWN_E_MUX_ERROR                               =  -8,
	LOCKDOWN_E_NO_RUNNING_SESSION                      =  -9,
	/* native */
	LOCKDOWN_E_INVALID_RESPONSE                        = -10,
	LOCKDOWN_E_MISSING_KEY                             = -11,
	LOCKDOWN_E_MISSING_VALUE                           = -12,
	LOCKDOWN_E_GET_PROHIBITED                          = -13,
	LOCKDOWN_E_SET_PROHIBITED                          = -14,
	LOCKDOWN_E_REMOVE_PROHIBITED                       = -15,
	LOCKDOWN_E_IMMUTABLE_VALUE                         = -16,
	LOCKDOWN_E_PASSWORD_PROTECTED                      = -17,
	LOCKDOWN_E_USER_DENIED_PAIRING                     = -18,
	LOCKDOWN_E_PAIRING_DIALOG_RESPONSE_PENDING         = -19,
	LOCKDOWN_E_MISSING_HOST_ID                         = -20,
	LOCKDOWN_E_INVALID_HOST_ID                         = -21,
	LOCKDOWN_E_SESSION_ACTIVE                          = -22,
	LOCKDOWN_E_SESSION_INACTIVE                        = -23,
	LOCKDOWN_E_MISSING_SESSION_ID                      = -24,
	LOCKDOWN_E_INVALID_SESSION_ID                      = -25,
	LOCKDOWN_E_MISSING_SERVICE                         = -26,
	LOCKDOWN_E_INVALID_SERVICE                         = -27,
	LOCKDOWN_E_SERVICE_LIMIT                           = -28,
	LOCKDOWN_E_MISSING_PAIR_RECORD                     = -29,
	LOCKDOWN_E_SAVE_PAIR_RECORD_FAILED                 = -30,
	LOCKDOWN_E_INVALID_PAIR_RECORD                     = -31,
	LOCKDOWN_E_INVALID_ACTIVATION_RECORD               = -32,
	LOCKDOWN_E_MISSING_ACTIVATION_RECORD               = -33,
	LOCKDOWN_E_SERVICE_PROHIBITED                      = -34,
	LOCKDOWN_E_ESCROW_LOCKED                           = -35,
	LOCKDOWN_E_PAIRING_PROHIBITED_OVER_THIS_CONNECTION = -36,
	LOCKDOWN_E_FMIP_PROTECTED                          = -37,
	LOCKDOWN_E_MC_PROTECTED                            = -38,
	LOCKDOWN_E_MC_CHALLENGE_REQUIRED                   = -39,
	LOCKDOWN_E_UNKNOWN_ERROR                           = -256
} lockdownd_error_t;

https://github.com/libimobiledevice/libimobiledevice/blob/master/include/libimobiledevice/lockdown.h

Metadata

Metadata

Labels

platform-iosiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions