there’s a simple way to build your Xcode project from command line:
assume your project test.xcodeproj has two targets: testing and release.
Building the release target is simple:
xcodebuild -project test.xcodeproj -configuration release -target release
Once Xcode has finished building you’ll find your .ipa in the directory