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 CallCore 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:
| Status | Field | Description |
|---|---|---|
| Online Status | - | Device appears in device list |
| USB Status | plugged | Whether USB hardware is ready, operations can only be performed when true |
Available Interfaces
Query Operations
| Interface | Description | Documentation |
|---|---|---|
getDevices | Get all device list and detailed information | View Documentation |
Management Operations
| Interface | Description | Status |
|---|---|---|
renameDevice | Modify device name | 📝 To be completed |
removeDevice | Remove 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:
- ✅ Is the iOS device connected to iClick hardware
- ✅ Is iClick hardware connected to the computer
- ✅ Is the device displayed in the iClick app
- ✅ 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,
screenWidthandscreenHeightwill swap orientationvalue will change (1=portrait, 2=landscape)
Next Steps
- See Get Device List for detailed usage
- See Automation Operations to learn how to control devices
- See Multi-language Clients to learn how to connect to the API