Allow app to access to USB accessory

Hi, I have an iOS app that interacts with a USB accessory. This works fine when running on an iPhone or iPad. However, when I compile the app in Xcode to run on my M1 Mac, the app won't see any USB devices. The target I use is "My Mac (designed for iPad)" which was the path of least resistance when compared to trying Catalyst. Is it possible to give my app access to USB accessories when running on my Mac? If so, what settings do I need to change? I've tried setting the "com.apple.security.device.usb" entitlement to true to no avail. Is the issue that the app is running in some sort of sandbox?

Replies

I have an iOS app that interacts with a USB accessory.

Using External Accessory framework?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Using External Accessory framework?

Yeah, that's correct. I'm not the one who worked on that part, but I see from the comments and code that it monitors iOS ExternalAccessory.framework for devices.

Oh, I just found this in the documentation:

iPad and iPhone apps running on a Mac with Apple silicon can’t connect to external accessories using this framework. You may continue to link apps to this framework and run other features on Apple silicon.

So it seems that I have no recourse? Would adding support for Catalyst address this problem? Originally, I only wanted to run my app on my Mac so that I can use Instruments with the external USB device connected. Using Instruments wirelessly on my iPad slows everything down to a crawl (wireless profiling is needed since I only have one port available in my iPad)

I just found this in the documentation

Yep.

Would adding support for Catalyst address this problem?

No. The issue here is that the back-end of the EA framework is not present on Mac. The framework is there, but you can’t use it to talk to an accessory. This affects iOS Apps on Mac and Mac Catalyst apps equally.

Now, if this were some random accessory you could build a Mac app and then talk to it via the macOS’s USB APIs. However, your goal is specifically tied to EA framework and so the Mac’s flexibility isn’t going to help you.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

That's a bummer. Thank you very much for your help!