Socket
Socket
Sign inDemoInstall

devicy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devicy

Cross platform real-time detection of connected Android and iOS devices


Version published
Weekly downloads
6
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

devicy

devicy is a Node.js library designed for real-time detection of connected Android and iOS devices. It offers a simple and efficient way to identify devices connected to your development environment, aiding in device management.

Installation

You can install devicy via npm:

npm install devicy

Usage

const { AndroidTracker, IosTracker } = require('devicy');

const deviceConnectedCallback = (device) => {
  console.log('*** Connected ***');
  console.log(device);
};

const deviceRemovecCallback = (device) => {
  console.log('*** Removed ***');
  console.log(device);
};

// Detect connected devices
const androidTracker = new AndroidTracker();
const iosTracker = new IosTracker();
androidTracker.addConnectionLister(deviceConnectedCallback);
androidTracker.addDisconnectionListner(deviceRemovecCallback);

iosTracker.addConnectionLister(deviceConnectedCallback);
iosTracker.addDisconnectionListner(deviceRemovecCallback);

await Promise.all([androidTracker.start(), iosTracker.start()]);

Sample Output

*** Connected ***
{
  name: 'iPhone 14 Pro Max',
  osVersion: '16.1',
  udid: 'EF970804-C846-44FA-87DD-BDBE1F0A04C5',
  type: 'emulator',
  model: 'Iphone',
  platform: 'ios',
  brand: 'Apple',
  connectedTime: 2024-05-11T09:39:55.490Z,
  image: 'https://fdn2.gsmarena.com/vv/bigpic/apple-iphone-14-pro-max-.jpg'
}
*** Connected ***
{
  udid: 'emulator-5554',
  name: 'Pixel_4_31',
  platform: 'android',
  type: 'emulator',
  model: 'sdk_gphone64_arm64',
  brand: 'Google',
  osVersion: '12',
  image: undefined
}

Features

  • Real-time Detection: devicy provides instant detection of Android and iOS devices connected to your system.
  • Cross-Platform: Works seamlessly on various operating systems including Windows, macOS, and Linux.
  • Simple API: Easy-to-use API for straightforward integration into your Node.js projects.

FAQs

Package last updated on 20 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc