I'm running following bash script
#!/bin/bash
echo Running RatiosUITests
xcodebuild \
test \
-project Ratios.xcodeproj \
-scheme RatiosUITests \
-destination 'platform=iOS Simulator,name=iPhone 13 mini'
variable=RatioUITest.sh | grep 'Test session results, code coverage, and logs:'|cut -f2 -d 'T'
echo $variable
it gives me tons of output:
...
2022-04-29 15:34:17.765 xcodebuild[4331:5066596] [MT] IDETestOperationsObserverDebug: 58.666 elapsed -- Testing started completed.
2022-04-29 15:34:17.765 xcodebuild[4331:5066596] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2022-04-29 15:34:17.765 xcodebuild[4331:5066596] [MT] IDETestOperationsObserverDebug: 58.666 sec, +58.666 sec -- end
Test session results, code coverage, and logs:
/Users/dmitrijsokolov/Library/Developer/Xcode/DerivedData/Ratios-caehxfsclkooshchojmcmrcadomd/Logs/Test/Test-RatiosUITests-2022.04.29_15-33-18-+0300.xcresult
Failing tests:
RatiosUITests:
...
And I want to store url of the file in a variable
url line I want is on the next line after "Test session results, code coverage, and logs:"
it's that one /Users/dmitrijsokolov/Library/Developer/Xcode/DerivedData/Ratios-caehxfsclkooshchojmcmrcadomd/Logs/Test/Test-RatiosUITests-2022.04.29_15-33-18-+0300.xcresult
it's changing all the time so I want to parse that file address.
Code with cut not working properly, please help(