-
Notifications
You must be signed in to change notification settings - Fork 356
/
benchmark.sh
62 lines (45 loc) · 1.96 KB
/
benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
readonly PATH_TO_PROJECT=$(pwd)/XcodeBenchmark.xcworkspace
readonly PATH_TO_DERIVED=$(pwd)/DerivedData
clear
echo "Preparing environment"
START_TIME=$(date +"%T")
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
if [ -n "$PATH_TO_PROJECT" ]; then
echo "Running XcodeBenchmark..."
echo "Please do not use your Mac while XcodeBenchmark is in progress\n\n"
xcodebuild -workspace "$PATH_TO_PROJECT" \
-scheme XcodeBenchmark \
-destination generic/platform=iOS \
-derivedDataPath "$PATH_TO_DERIVED" \
build
echo "System Version:" "$(sw_vers -productVersion)"
xcodebuild -version | grep "Xcode"
echo "Hardware Overview"
system_profiler SPHardwareDataType | grep "Model Name:"
system_profiler SPHardwareDataType | grep "Model Identifier:"
system_profiler SPHardwareDataType | grep "Processor Name:"
system_profiler SPHardwareDataType | grep "Processor Speed:"
system_profiler SPHardwareDataType | grep "Total Number of Cores:"
system_profiler SPHardwareDataType | grep "L2 Cache (per Core):"
system_profiler SPHardwareDataType | grep "L3 Cache:"
system_profiler SPHardwareDataType | grep "Number of Processors:"
system_profiler SPHardwareDataType | grep "Hyper-Threading Technology:"
system_profiler SPHardwareDataType | grep "Memory:"
system_profiler SPSerialATADataType | grep "Model:"
echo ""
echo "✅ XcodeBenchmark has completed"
echo "1️⃣ Take a screenshot of this window (Cmd + Shift + 4 + Space) and resize to include:"
echo "\t- Build Time (See ** BUILD SUCCEEDED ** [XYZ sec])"
echo "\t- System Version"
echo "\t- Xcode Version"
echo "\t- Hardware Overview"
echo "\t- Started" "$START_TIME"
echo "\t- Ended " "$(date +"%T")"
echo "\t- Date" `date`
echo ""
echo "2️⃣ Share your results at https://github.com/devMEremenko/XcodeBenchmark"
rm -rfd "$PATH_TO_DERIVED"
else
echo "XcodeBenchmark.xcworkspace was not found in the current folder"
echo "Are you running in the XcodeBenchmark folder?"
fi