Skip to content

Instantly share code, notes, and snippets.

@tai2
Created February 19, 2025 01:59
Show Gist options
  • Save tai2/f8de790325a12203c6d2b273e6b6b17d to your computer and use it in GitHub Desktop.
Save tai2/f8de790325a12203c6d2b273e6b6b17d to your computer and use it in GitHub Desktop.
device and simulator information
import { utilities } from "appium-ios-device";
import { getSimulator } from "appium-ios-simulator";
const main = async () => {
const udid_list = await utilities.getConnectedDevices();
console.log(udid_list);
for (const udid of udid_list) {
const deviceInfo = await utilities.getDeviceInfo(udid);
console.log(deviceInfo);
const osVersion = await utilities.getOSVersion(udid);
console.log(osVersion);
}
const sim = await getSimulator("2B2FA8A1-EC94-42BF-8F14-AC7143FF7702");
console.log(await sim.stat());
};
main();
$ node a.js
(node:8105) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///Users/tai2/appium-ios-device-test/a.js is not specified and it doesn't parse as CommonJS.
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
To eliminate this warning, add "type": "module" to /Users/tai2/appium-ios-device-test/package.json.
(Use `node --trace-warnings ...` to show where the warning was created)
[ '00008030-0008459A0A3B802E' ]
{
BasebandCertId: 524245983,
BasebandKeyHashInformation: { AKeyStatus: 64, SKeyStatus: 2 },
BasebandSerialNumber: <Buffer b0 5f 77 4a b1 af bc 83 00 00 00 00>,
BasebandVersion: '6.01.01',
BoardId: 16,
BuildVersion: '22D72',
CPUArchitecture: 'arm64e',
ChipID: 32816,
DeviceClass: 'iPhone',
DeviceColor: '1',
DeviceName: 'Taiju’s iPhone',
DieID: 2328327712636974,
HardwareModel: 'D79AP',
HasSiDP: true,
HumanReadableProductVersionString: '18.3.1',
PartitionType: 'GUID_partition_scheme',
ProductName: 'iPhone OS',
ProductType: 'iPhone12,8',
ProductVersion: '18.3.1',
ProductionSOC: true,
ProtocolVersion: '2',
SupportedDeviceFamilies: [ 1 ],
TelephonyCapability: true,
UniqueChipID: 2328327712636974,
UniqueDeviceID: '00008030-0008459A0A3B802E',
WiFiAddress: '48:26:2c:d7:f5:10'
}
18.3.1
info Simulator Constructing iOS simulator for Xcode version 16.2 with udid '2B2FA8A1-EC94-42BF-8F14-AC7143FF7702'
{
sdk: '18.2',
dataPath: '/Users/tai2/Library/Developer/CoreSimulator/Devices/2B2FA8A1-EC94-42BF-8F14-AC7143FF7702/data',
dataPathSize: 18341888,
logPath: '/Users/tai2/Library/Logs/CoreSimulator/2B2FA8A1-EC94-42BF-8F14-AC7143FF7702',
udid: '2B2FA8A1-EC94-42BF-8F14-AC7143FF7702',
isAvailable: true,
deviceTypeIdentifier: 'com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro',
state: 'Shutdown',
name: 'iPhone 16 Pro',
platform: 'iOS'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment