2015-04-22 23:04:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
|
ROOT=$(dirname $SCRIPTS)
|
|
|
|
|
|
|
|
export REACT_PACKAGER_LOG="$ROOT/server.log"
|
|
|
|
|
|
|
|
cd $ROOT
|
|
|
|
|
|
|
|
function cleanup {
|
|
|
|
EXIT_CODE=$?
|
|
|
|
set +e
|
|
|
|
|
|
|
|
if [ $EXIT_CODE -ne 0 ];
|
|
|
|
then
|
|
|
|
WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log
|
|
|
|
[ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS
|
|
|
|
|
|
|
|
[ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG
|
|
|
|
fi
|
2015-06-11 00:53:17 +00:00
|
|
|
[ $SERVER_PID ] && kill -9 $SERVER_PID
|
2015-04-22 23:04:06 +00:00
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
2015-10-22 18:17:29 +00:00
|
|
|
./packager/packager.sh --nonPersistent &
|
2015-06-11 00:53:17 +00:00
|
|
|
SERVER_PID=$!
|
2015-04-22 23:04:06 +00:00
|
|
|
xctool \
|
|
|
|
-project Examples/UIExplorer/UIExplorer.xcodeproj \
|
2016-01-06 10:50:08 +00:00
|
|
|
-scheme UIExplorer -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=9.2' \
|
2015-04-22 23:04:06 +00:00
|
|
|
test
|