Sponsored Content
Operating Systems OS X (Apple) Detect active usb device used by app Post 303037958 by dallas88 on Monday 19th of August 2019 11:09:59 PM
Old 08-20-2019
Detect active usb device used by app

I've searched a number of sites but thought I'd post it here. I'm want to a detect certain usb device (external camera) that is actively being used by an app on a mac.
My search has led me through looking at the system events log to see if there is a ProductID indicator logged. The device is plugged into the same so researching on how to check any output from the port.
Anyone thoughts on additional ways to tackle this? am i in the right place> appreciate any feedback

So for I have a bash script that detects the usb devices on a mac
Code:
# USB Devices detected 
log "List of USB Devices " 
log ""
USB=`ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*'`
log "$USB"


The following usb devices detected and written to a log file:
Code:
AppleUSBEHCI Root Hub Simulation
IOUSBHostDevice
IOUSBHostDevice
Apple Internal Keyboard / Trackpad
IR Receiver
BRCM20702 Hub
Bluetooth USB Host Controller
Keyboard Hub
Apple Keyboard
AppleUSBXHCI Root Hub Simulation


Last edited by dallas88; 08-20-2019 at 12:16 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Can't detect usb thumbdrive anymore

hey everyone! i have a Solaris 8 box with me, and i had been using my usb thrumbdrive on it all the time. one day, i was in a rush and i pulled out the thumbdrive without ejecting it or anything. and now i can't detect any thumbdrives at all. i had tried using another thumbdrive, but with no... (2 Replies)
Discussion started by: feef
2 Replies

2. Windows & DOS: Issues & Discussions

How to detect if a Windows app dies??

Hello All: I hope this is the right category... I have a application (this app runs under java and jboss) that runs under Windows, it's started as a service. If that application should become disabled, crash or no longer function, what would be the best method for determining it is no longer... (6 Replies)
Discussion started by: jimmyc
6 Replies

3. Linux

mounting usb device

Hi Folks, I want to know how to mount usb device (cd,dvd etc) in linux, Regards, Manoj (4 Replies)
Discussion started by: manoj.solaris
4 Replies

4. Solaris

Usb Device

AM TRYING TO CONNECT A USB EXTERNAL DRIVE FOR BACKUP,THE USB SLOT IS AVAILABLE,BUT I DONT KNOW IF IT IS READY WHEN I CONNECT IT,AND WHAT COMMANDS DO I NEED. tHANKS (10 Replies)
Discussion started by: tomjones
10 Replies

5. Programming

How to detect usb storage arrival and its mount path from C

Hi, I am a newbi to linux, i wana to write a program in C that can detect arrival of a usb flash memory. I want also to find the actual mount point of new inserted flash disk. can anyone help me? thanks a lot (6 Replies)
Discussion started by: aghashahi
6 Replies

6. Shell Programming and Scripting

BASH Script to Detect and List USB Flash Drives

Hello. This is my first post to this forum. I've read many of the posts over the last two or three years and I've learned a lot. I'm creating a live Linux distribution using the Linux Live Scripts -- just as a hobby project -- and I'm wanting to create an automated way for a user to copy the... (7 Replies)
Discussion started by: godzillarama
7 Replies

7. Shell Programming and Scripting

Detect USB keyboard and other peripherals

Hi there, I have a Debian machine without any peripherals (no screen, no keyboard, etc.). I'd like to be able to detect and log when someone plugs a USB keyboard. Something like : 2009-07-04 12:21 warning: keyboard pluged! Is that possible? I see two ways : 1. Either actively react to the... (4 Replies)
Discussion started by: chebarbudo
4 Replies

8. Shell Programming and Scripting

script to detect a file from inserted usb and puts into a Variable

There is a same named log file that I have on my 2 different android phones. When I plug it into my computer, it appears in the media folder, For example the first android phone: /media/F6BA-0AF5/folder/A.log I want to put that into a variable to be manipulated.... (3 Replies)
Discussion started by: tobenguyen
3 Replies

9. UNIX for Advanced & Expert Users

USB Device Identification

In linux system when a pnp usb device is plugged in then how does the system gets a notification of it? I mean to say in linux usb system there is usb host controller above which is host controller driver above which is usb core. So does the host controller/usb core keeps on polling the usb bus... (1 Reply)
Discussion started by: rupeshkp728
1 Replies

10. UNIX for Advanced & Expert Users

Tar on usb device

Hi, i am developing an application on an ARM 7 architatcure with a small Linux. i want to run tar on a usb device (~10 Mb) but it runs realy slow. the command only takes 1% of cpu usage. is there a way to improve the tar command or is the USB-Connection the bottleneck here? (4 Replies)
Discussion started by: louisk
4 Replies
lsusb(8)							Linux USB Utilities							  lsusb(8)

NAME
lsusb - list all USB devices SYNOPSIS
lsusb [options] DESCRIPTION
lsusb is a utility for displaying information about all USB buses in the system and all devices connected to them. To make use of all the features of this program, you need to have Linux kernel 2.3.15 or newer which supports the /proc/bus/usb interface. OPTIONS
-v Tells lsusb to be verbose and display detailed information about all devices. -vv Tells lsusb to be very verbose and display even more information (actually everything the PCI device is able to tell). -s [[<bus>]:][<devnum>]] Show only devices in specified bus and devnum. -d [<vendor>]:[<product>] Show only devices with specified vendor and product ID. Both ID's are given in hexadecimal and may be omitted. -p <procpath> Use another path instead of /proc/bus/usb. -D <device> Do not scan the /proc/bus/usb directory, instead display only information if the device whose device file is given. -t Tells lsusb to dump the physical USB device hierarchy as a tree. FILES
/usr/share/hwdata/usb.ids A list of all known USB ID's (vendors, products, classes, subclasses and protocols). /proc/bus/usb An interface to USB devices provided by the post-2.3.15 Linux kernels. Contains per-bus subdirectories with per-device files and a devices file containing a list of all USB devices. SEE ALSO
lspci(8) AUTHOR
Thomas Sailer, <sailer@ife.ee.ethz.ch>. usbutils-0.2 14 September 1999 lsusb(8)
All times are GMT -4. The time now is 06:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy