If you want a step-by-step script that performs these actions for a specific .ipa and signing identity, tell me:
git clone https://github.com/alexzielenski/optool.git cd optool && xcodebuild # Copy the binary to /usr/local/bin
Ensure your dylib is compiled for the correct architecture (usually arm64 for modern iPhones).