3

I am building an external cooling fan controller and I need to read the CPU temperature in my Swift app.

For this purpose, I applied the answer to this thread and I managed to read the temperatures in a Swift Command Line Tool but when I try to do the exact same thing in a Swift App I get this output when I call SMCOpen():

Error: IOServiceOpen() = e00002e2

At first, I thought it was because of my info.plist file but modifying it (according to the aforementioned thread) did not solve the problem and I could not find any workarounds. Is there a solution to this problem?

P.S. I am fairly new to Swift programming and SMCOpen() method is called in Appdelegate.swift

Edit: This app will be personal use only, you can disregard App Store policies.

2
  • Is it a sandboxed app ? Commented Jul 17, 2020 at 11:37
  • I did not explicitly sandbox it, i.e., info.plist does not have a sandbox key(but I tried adding it and setting it to true and false and nothing changed for both cases) but I do not know the default behavior. Commented Jul 17, 2020 at 13:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.