I\'d like to pass command line arguments to my iOS tests through the command line (xcodebuild). I\'m looking for the equivalent of this setting on XCode:
Simply
To add to @ManWithBear's answer, I ended up doing this in a script:
#Remove previous command line arguments
/usr/libexec/PlistBuddy -c "Delete DetoxTestRunner:CommandLineArguments" "$TESTRUN" || true
#Add an empty array
/usr/libexec/PlistBuddy -c "Add DetoxTestRunner:CommandLineArguments array" "$TESTRUN"
#Add script arguments as launch arguments of the test runner app
for i in $*; do
/usr/libexec/PlistBuddy -c "Add DetoxTestRunner:CommandLineArguments: string '$i'" "$TESTRUN"
done
In the code above, I add all arguments passed to a script as launch argument to the tester app. DetoxTestRunner
is the name if the test scheme/target.