Have you actually read the licensing terms you agreed to for Xcode and Apple SDKs?

> Except as otherwise expressly set forth in Section 2.2.B., You may not distribute any Applications developed using the Apple SDKs (excluding the macOS SDK) absent entering into a separate written agreement with Apple.