export GOARM=7
fi
-# Reboot to make sure previous runs do not interfere with the current run.
-# It is reasonably easy for a bad program leave an iOS device in an
-# almost unusable state.
-idevicediagnostics restart
-# Initial sleep to make sure we are restarting before we start polling.
-sleep 30
-# Poll until the device has restarted.
-until idevicediagnostics diagnostics; do
- # TODO(crawshaw): replace with a test app using go_darwin_arm_exec.
- echo "waiting for idevice to come online"
- sleep 10
-done
-# Diagnostics are reported during boot before the device can start an
-# app. Wait a little longer before trying to use the device.
-sleep 30
+if [ "$1" == "-restart" ]; then
+ # Reboot to make sure previous runs do not interfere with the current run.
+ # It is reasonably easy for a bad program leave an iOS device in an
+ # almost unusable state.
+ idevicediagnostics restart
+ # Initial sleep to make sure we are restarting before we start polling.
+ sleep 30
+ # Poll until the device has restarted.
+ until idevicediagnostics diagnostics; do
+ # TODO(crawshaw): replace with a test app using go_darwin_arm_exec.
+ echo "waiting for idevice to come online"
+ sleep 10
+ done
+ # Diagnostics are reported during boot before the device can start an
+ # app. Wait a little longer before trying to use the device.
+ sleep 30
+fi
unset GOBIN
export GOROOT=$(dirname $(pwd))
export CC_FOR_TARGET=$GOROOT/misc/ios/clangwrap.sh
# Run the build for the host bootstrap, so we can build go_darwin_arm_exec.
-# Also lets us fail early before the (slow) adb push if the build is broken.
+# Also lets us fail early before the (slow) ios-deploy if the build is broken.
./make.bash
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \