DeviceKit icon indicating copy to clipboard operation
DeviceKit copied to clipboard

Add support for Apple Vision Pro

Open edorphy opened this issue 1 year ago • 8 comments

New device coming soon. Has anyone had a chance at a developer lab with the Apple Vision Pro to know what the hardware id is?

I'm trying to reliably determine if the app running in Designed for iPad mode is on visionOS or not. There is no ProcessInfo .isVision func like there is for running on Mac.

edorphy avatar Jan 26 '24 10:01 edorphy

@Zandor300 Please add enough support so we can compile on visionOS for now, actual features can come later.

gabors avatar Jan 30 '24 01:01 gabors

I'm working on a fork that does support visionOS and macOS. If you're interested in contributing there, try http://github.com/kudit/DeviceKit

kudit avatar Jan 31 '24 20:01 kudit

I am currently on holiday, next week I will try to take a look. @gabors

Zandor300 avatar Feb 01 '24 05:02 Zandor300

@edorphy I am curious, you would like to detect if you are running on visionOS using 'Designed for iPad' mode or natively. What will DeviceKit report as device when the app is running on visionOS? Have you tried this already?

Zandor300 avatar Feb 06 '24 21:02 Zandor300

I've created a spinoff project that supports visionOS and macOS and can be developed using Swift Playgrounds in addition to Xcode. It's designed to be easier to maintain with new device idioms and versions. If you have any feedback, please let me know. http://github.com/kudit/Device

kudit avatar Mar 20 '24 14:03 kudit

@kudit I've created this a while ago that has I use for Mac info, it has lots of Mac data, except the recent M3 crop

https://github.com/voyager-software/MacLookup

gabors avatar Mar 20 '24 16:03 gabors

@Zandor300 It would be good first and foremost to add platform support for this, and macOS, in the swift package itself. This at least helps us not have to conditionally link the framework. I understand there is more work because not all of the things like screen dimensions apply. Those would be appropriately marked with @unavailable as necessary. https://github.com/devicekit/DeviceKit/blob/fe41d18eccd92a115cffaa35dfff03018c67e635/Package.swift#L17

As for decoding WHEN on visionOS, there is only one device that reports as "RealityDevice14,1" --> Apple Vision Pro.

When you're running in "Designed for iPad" mode, the device reports itself as an iPad and you can't tell that it is visionOS. There isn't a ProcessInfo property like there is for detecting Apple Silicon :(

edorphy avatar Mar 20 '24 18:03 edorphy

@kudit I've created this a while ago that has I use for Mac info, it has lots of Mac data, except the recent M3 crop

https://github.com/voyager-software/MacLookup

@gabors That's awesome! I'll try to write a script to put it in the format for adding to kudit/Device. I should be able to add colors and your other fields as additional parameters in the Mac spec and update my "Form" enum to include various descriptions. Thank you!

kudit avatar Mar 21 '24 02:03 kudit