With an existing project, the shell command didn’t work for me at first (complained about platform not being set up correctly). So I created a new project from the 1st person template on my Mac, to see if that would build (it did). Did an iOS build, too.
Then I ran the shell command again on my existing project, and it worked. (UE 5.1.1)