Android is not supported
Summary
- OS: Android 10
- Architecture: aarch64
- Psutil version: 7.0.0
- Python version: 3.12.10
- Type: installation
I don't think Android is supported. According to the error it seems the missing piece is the freeifaddrs() syscall (and also getifaddrs()?). I suppose the right solution is to disable that part of the C code with an #ifdef, and just don't support that psutil.net_if_addrs() on Android. But I never developed on Android, nor I have one, nor I have any idea how to setup the whole dev environment etc. So either somebody steps in with a patch or this ticket is likely gonna linger. undefinitively
I've built some unofficial Android wheels for psutil here, based on the patches here, which treat Android as if it's Linux.
However, I've never throroughly tested them beyond some basic checks of the disk and process APIs. In particular, if you look at the history of the recipe, you'll see that I previously removed a test for the network API because Android was blocking that information for privacy reasons.
I previously removed a test for the network API because Android was blocking that information for privacy reasons
However, this isn't the cause of the compiler error above. That's happening because Android doesn't support getifaddrs and freeifaddrs until API level 24. So you should at least be able to finish the build by targeting API level 24 or newer, but I'm not sure how to do that on Termux (assuming that's what you're using).