Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works in Editor, not in Builds #4

Open
dbitkowski opened this issue Oct 19, 2023 · 6 comments
Open

Works in Editor, not in Builds #4

dbitkowski opened this issue Oct 19, 2023 · 6 comments

Comments

@dbitkowski
Copy link

I've successfully got HIDUE to work in the Editor. I can initialize, open, and read my hid device just fine. However, when I make a build (tried Development, Debug, and Shipment build), it can no longer open the device.

Unreal 5.3.1
MacOS Ventura

I did try to do a hid_error, which returns just "h" for the error (not sure what that means)

@microdee
Copy link
Owner

microdee commented Oct 19, 2023

interesting, did you manage to get the editor functionality working on MacOS? What did you need to change?
Sorry I thought this was the SpaceMouse repo, did you use this in your own plugin?

@dbitkowski
Copy link
Author

I copied the HIDUE plugin into the Plugins directory of my Unreal project, which brought it into the project. I did not see the SpaceMouse repo.

The build is able to do things like hid_init(); so there is a link to the plugin there in the build, but when I call hid_open, in editor, it works, I can hid_read and everything, get information back, but as soon as I try to run the build, it does not return a handle to a working device with hid_open.

@dbitkowski
Copy link
Author

Ok, so after debugging the issue further, it seems that on Mac, I'm receiving a kIOReturnNotPermitted error on builds.

@dbitkowski
Copy link
Author

I've finally resolved this issue. On MacOS, I needed to sign the build with an entitlements file that included com.apple.security.device.usb = true
Without this, I was getting Not Permitted errors.

@microdee
Copy link
Owner

@dbitkowski very good find! maybe that's the issue with my plugin as well where I use this. Do you know if adding this "entitlements file" is controllable via the plugin? like how UPL can control OS specific package metadata for mobile platforms?

@dbitkowski
Copy link
Author

dbitkowski commented Oct 30, 2023

@microdee I haven't tried adding the entitlements through Unreal or through the Plugin yet. Right now, I just run a manual process after making the build.

codesign --deep -f -v -s "Developer ID Application: My Company (My Company Apple ID)" --entitlements "MyApp.entitlements" "MyApp.app"

And the entitlements file looks something like this:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
	       <key>com.apple.security.cs.disable-library-validation</key>
	       <true/>
	       <key>com.apple.security.cs.disable-executable-page-protection</key>
	       <true/>
	       <key>com.apple.security.device.usb</key>
	       <true/>
    </dict>
</plist>```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants