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.

user142985
  • 43
  • 4
  • Is it a sandboxed app ? – claude31 Jul 17 '20 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. – user142985 Jul 17 '20 at 13:50

0 Answers0