forked from facebookarchive/instruments-without-delay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·41 lines (34 loc) · 1.01 KB
/
build.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1.01 KB
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
#!/bin/sh
set -e
cd `dirname $0`
BUILD_OUTPUT_DIR=$(echo `pwd`/build)
xcodebuild \
-workspace instruments-without-delay.xcworkspace \
-scheme ios-dylibs \
-configuration Release \
-sdk iphonesimulator \
CONFIGURATION_BUILD_DIR=$BUILD_OUTPUT_DIR
xcodebuild \
-workspace instruments-without-delay.xcworkspace \
-scheme instruments-without-delay \
-configuration Release \
CONFIGURATION_BUILD_DIR=$BUILD_OUTPUT_DIR
cp instruments $BUILD_OUTPUT_DIR/instruments
if [[ $1 == "test" ]]; then
TEST_JS=$(echo `pwd`/test.js)
XCODE_PATH=$(xcode-select --print-path)
OUTPUT_DIR=$(/usr/bin/mktemp -d -t trace)
if [[ -n $2 ]]; then
SIMULATOR_NAME="$2"
else
SIMULATOR_NAME="iPhone 5 (8."
fi
pushd $OUTPUT_DIR
$BUILD_OUTPUT_DIR/instruments \
-t "$XCODE_PATH"/../Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.*/Contents/Resources/Automation.tracetemplate \
-w $SIMULATOR_NAME \
$BUILD_OUTPUT_DIR/TestApp.app \
-e UIASCRIPT $TEST_JS
popd
rm -rf $OUTPUT_DIR
fi