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.