pub struct Session<'a>(/* private fields */);Implementations§
Source§impl<'a> Session<'a>
impl<'a> Session<'a>
pub unsafe fn mound_disk_with_callback<T>( &self, image: &String, options: &Dictionary, callback: *const MountCallback<T>, ctx: *mut T, ) -> Error
pub fn mount_developer_image(&self) -> Result<(), Error>
pub fn mound_disk( &self, image_path: &String, options: &Dictionary, ) -> Result<(), Error>
Sourcepub fn relay_file(&self, source: &String, options: &Dictionary) -> Error
pub fn relay_file(&self, source: &String, options: &Dictionary) -> Error
Copy a file from the relay service. Options must contain:
kAMDRelayTypeKey: one of kAMDRelayTypeFileDescriptor kAMDRelayTypeData
Source§impl<'a> Session<'a>
impl<'a> Session<'a>
Sourcepub fn lookup_apps(&self, options: &Dictionary) -> Result<R<Dictionary>, Error>
pub fn lookup_apps(&self, options: &Dictionary) -> Result<R<Dictionary>, Error>
Lookup the set of installed applications on the device.
The info argument will point to a cf::Dictionary. Each key in the dictionary is an application identifier and the value is the Info.plist of the installed application.
The client can specify options to filter the results. If the value of kLookupAttributeKey is: IMPORTANT NOTE: You should specify kLookupReturnAttributesKey in the options dictionary with an array value containing those keys you would like returned. If you do not specify this attribute, MobileDevice will log every time you make an offending call and performance will be poor. When specifying this key, you MUST include at least kCFBundleIdentifierKey in the array of keys to be returned or the call will not work properly.
pub fn apps_lookup(&'a self) -> AppsLookupBuilder<'a>
Source§impl<'a> Session<'a>
impl<'a> Session<'a>
Sourcepub fn secure_start_service(
&self,
name: &String,
) -> Result<R<ServiceConnection>, Error>
pub fn secure_start_service( &self, name: &String, ) -> Result<R<ServiceConnection>, Error>
Securely start a service on the device specifying options.
Starts a service on the device. Requires that a session with the device be active. Attempting to start a service without an active session will result in kAMDInvalidArgumentError. Fails with kAMDNoWifiSyncSupportError if the device side service does not support SSL. Fails with kAMDServiceProhibitedError if the service is not allowed to run. Some services are only allowed to run when a device has been activated.
The device may request that a connection be encrypted. If so, this call will also perform the initial SSL handshake. See <MobileDevice/AMDServiceConnection.h> for more information on using the service connection.
§Options
kAMDServiceOptionTimeoutConnection - The service connection will have SO_SNDTIMEO and SO_RCVTIMEO set. It will be closed if either input or output operations fail to complete within 25 seconds (use carefully if you expect your service to perform long-lived operations on your behalf). Valid values are boolean true or false. This is off by default.
kAMDServiceOptionUnlockEscrowBag - Attempt the passcode-unlock the device when starting a service.
kAMDOptionCloseOnInvalidate - The returned service connection will take ownership of the underlying file descriptor and SSL context. Manually closing the fd or SSL_free()’ing the ssl context will result in an double free()s and close()s when the service connection object is invalidate or ultimately released. Valid values are boolean true or false. This is on by default.
On success, the AMDServiceConnection returned in service_out must be CFRelease()’d by the caller.
pub fn start_debug_server(&self) -> Result<R<ServiceConnection>, Error>
pub fn battery_level(&self) -> Option<R<Number>>
Methods from Deref<Target = Connected<'a>>§
pub fn device_support_path(&self) -> Option<PathBuf>
pub unsafe fn copy_value( &self, domain: Option<&String>, key: Option<&String>, ) -> Option<R<Type>>
Sourcepub unsafe fn copy_value_with_err(
&self,
domain: Option<&String>,
key: Option<&String>,
error_out: &mut Error,
) -> Option<R<Plist>>
pub unsafe fn copy_value_with_err( &self, domain: Option<&String>, key: Option<&String>, error_out: &mut Error, ) -> Option<R<Plist>>
Copy a value from the device @param device The device to copy from @param domain The domain to query. May be NULL. @param key The key to query. May be NULL. @param error_out On return, an error code describing the result of the operation. May be NULL. @result A new plist value, or NULL.
Copies a value from the lockdown property store. A key argument of NULL asks for the contents of the whole domain. A domain argument of NULL asks for the global domain. Some properties are unavailable outside of a session.
Returns kAMDDeviceDisconnectedError is the device is no longer attached. Returns kAMDInvalidArgumentError if device is not a valid device ref, or if domain or key arguments are non-NULL and not string.
pub fn try_value( &self, domain: Option<&String>, key: Option<&String>, ) -> Result<R<Plist>, Error>
pub fn domain_value(&self, domain: &String) -> Option<R<Type>>
pub fn value(&self, key: &String) -> Option<R<Type>>
pub fn name(&self) -> R<String>
pub fn cpu_arch(&self) -> R<String>
pub fn hardware_model(&self) -> R<String>
pub fn product_name(&self) -> R<String>
pub fn product_type(&self) -> R<String>
pub fn product_version(&self) -> R<String>
Sourcepub fn start_session(&'a self) -> Result<Session<'a>, Error>
pub fn start_session(&'a self) -> Result<Session<'a>, Error>
Start a session with the device.
You must have paired with the device before you can start a session. A return value of kAMDInvalidPairRecordError is possible if the pair records have been damaged. In this case the pairing records will be discarded and the device connection will be shut down.
To recover: AMDeviceConnect(), AMDeviceUnpair(), AMDevicePair() and try to start a session again.
Methods from Deref<Target = Device>§
pub fn retained(&self) -> R<Self>
pub fn connection_id(&self) -> u32
pub fn id(&self) -> R<String>
Sourcepub fn connected<'a>(&'a self) -> Result<Connected<'a>, Error>
pub fn connected<'a>(&'a self) -> Result<Connected<'a>, Error>
Connect to the mobile device.
If you are already connected, this function will attempt to verify that the connection is still open.
Returns Error::WRONG_DROID if the device is in the restore OS.
Sourcepub fn is_paired(&self) -> bool
pub fn is_paired(&self) -> bool
Checks to see whether or not we are paired with the device.
Only checks locally. May return true even if not paired. This may happen if the device has recently been restored. Use AMDeviceValidatePair() to confer with device about pair-ed-ness. Can be done without having a session.
FOR ALMOST ALL USAGES, am::Device::validate_pairing() IS BETTER!
Sourcepub fn pair(&self) -> Result<(), Error>
pub fn pair(&self) -> Result<(), Error>
Create a pairing relationship with an iOS device This is equivalent to calling AMDevicePairWithOptions with options set to NULL
Sourcepub fn validate_pairing(&self) -> Result<(), Error>
pub fn validate_pairing(&self) -> Result<(), Error>
Validate the pairing with the device.
Checks to see if the host and device are paired. Prefer this to am::Device::is_paired(). On success, the device will also be notified that it is attached to a Trusted Host.
pub fn secure_install_app(&self, url: &Url, options: &Dictionary) -> Result
pub fn secure_transfer_path(&self, url: &Url, options: &Dictionary) -> Result
pub fn iface_type(&self) -> IfaceConnectionType
Methods from Deref<Target = Type>§
pub fn get_type_id(&self) -> TypeId
pub unsafe fn as_type_ptr(&self) -> *const c_void
pub fn as_type_ref(&self) -> &Type
pub fn is_tagged_ptr(&self) -> bool
pub fn try_as_number(&self) -> Option<&Number>
pub fn try_as_string(&self) -> Option<&String>
pub fn show(&self)
pub fn allocator(&self) -> Option<&Allocator>
pub fn retain_count(&self) -> isize
Sourcepub fn equal(&self, other: &Type) -> bool
pub fn equal(&self, other: &Type) -> bool
use cidre::cf;
let n1 = cf::Number::from_i8(4);
let n2 = cf::Number::from_i32(4);
let n3 = cf::Number::from_f64(3.0);
assert!(n1.equal(&n2));
assert_eq!(false, n1.equal(&n3));