You must own genuine Apple hardware even for virtualised macOS instances. Apple permits macOS VMs only on Apple-branded machines. Practically, even if you skirt licensing, GPU passthrough limits make the iOS 18 simulator crawl on most Hyper-V or KVM hosts.
If budget is the blocker, consider Apple’s Xcode Cloud or third-party CI services that compile and notarise your build remotely; you can still write code on Windows/Linux and push via Git. For Android work, Google’s latest system-requirements page says 8 GB RAM is minimum, 16 GB recommended, and any post-2017 Intel/AMD CPU with VT-x/AMD-V will handle the Emulator at 60 fps. Mixing these approaches keeps you license-clean and within NIST 800-163 guidance that discourages unvetted VMs for signing keys.
References
Stack Overflow VM licensing thread
Android Studio system-requirements page
NIST SP 800-163