Skip to content

Device Management

iClick provides comprehensive device management interfaces to get, manage, and control connected iOS devices.

Device Connection Flow

iOS Device → Lightning Cable → USB Hub → iClick Hardware → Computer

                                            WebSocket API Call

Core Concepts

Device ID

Each connected device has a unique Device ID used to identify and operate that device.

javascript
// Device ID example
"P72578581E07"

Device Status

Devices have two key statuses:

StatusFieldDescription
Online Status-Device appears in device list
USB StatuspluggedWhether USB hardware is ready, operations can only be performed when true

Available Interfaces

Query Operations

InterfaceDescriptionDocumentation
getDevicesGet all device list and detailed informationView Documentation

Management Operations

InterfaceDescriptionStatus
renameDeviceModify device name📝 To be completed
removeDeviceRemove device📝 To be completed

Quick Start

Get Device List

javascript
// Get all devices
const devices = await apiInvoke('getDevices');

// Iterate devices
for (const deviceId in devices) {
    const device = devices[deviceId];
    console.log(`Device: ${device.info.deviceName}`);
    console.log(`  ID: ${deviceId}`);
    console.log(`  Resolution: ${device.info.screenWidth}x${device.info.screenHeight}`);
    console.log(`  Status: ${device.plugged ? 'Ready' : 'Not Ready'}`);
}

Select Available Device

javascript
// Get first available device
async function getFirstDevice() {
    const devices = await apiInvoke('getDevices');
    
    for (const deviceId in devices) {
        if (devices[deviceId].plugged) {
            return deviceId;
        }
    }
    
    throw new Error('No available devices');
}

// Usage
const deviceId = await getFirstDevice();
console.log('Selected device:', deviceId);

Device Information Fields

info Object

Each device's info object contains the following fields:

javascript
{
    deviceName: "My iPhone",               // Device name
    deviceIdentifier: "iPhone15,2",        // Device model identifier
    deviceChip: "COM3",                    // USB chip ID
    screenWidth: 1179,                     // Screen width
    screenHeight: 2556,                    // Screen height
    orientation: 1,                        // Orientation (1=portrait, 2=landscape)
    screenScale: 3.0,                      // Screen scale ratio
    deviceVersion: "17.0",                 // iOS version
    deviceRounded: true                    // Whether rounded screen
}

Common Issues

❓ What to do if device list is empty?

Check:

  1. ✅ Is the iOS device connected to iClick hardware
  2. ✅ Is iClick hardware connected to the computer
  3. ✅ Is the device displayed in the iClick app
  4. ✅ Is network connection normal

❓ What does plugged false mean?

It means the device is online (connected via network), but USB hardware is not ready. Possible reasons:

  • USB cable not plugged in properly
  • iClick hardware not started
  • USB Hub insufficient power supply

❓ How to distinguish different device models?

Use the deviceIdentifier field, different models have different identifiers (e.g., iPhone15,2 represents iPhone 14 Pro).

❓ When does screen information change?

  • When device switches between portrait and landscape, screenWidth and screenHeight will swap
  • orientation value will change (1=portrait, 2=landscape)

Next Steps

Cooperation: try.catch@foxmail.com