envsetup: Add pushboot function
This function lets you push a file from your current OUT dir
for your current device. It root/remount the device, push the
file, and reboots it. Example: pushboot system/app/SystemUI.apk
Change-Id: I8a404323a4091e8502fbdd24198c66f1ac598192
diff --git a/build/envsetup.sh b/build/envsetup.sh
index 7b341c9..5655d62 100644
--- a/build/envsetup.sh
+++ b/build/envsetup.sh
@@ -6,6 +6,8 @@
- brunch: Sets up build environment using breakfast(),
and then comiles using mka() against bacon target.
- mka: Builds using SCHED_BATCH on all processors.
+- pushboot: Push a file from your OUT dir to your phone and
+ reboots it, using absolute path.
EOF
}
@@ -63,3 +65,18 @@
;;
esac
}
+
+function pushboot() {
+ if [ ! -f $OUT/$* ]; then
+ echo "File not found: $OUT/$*"
+ return 1
+ fi
+
+ adb root
+ sleep 1
+ adb wait-for-device
+ adb remount
+
+ adb push $OUT/$* /$*
+ adb reboot
+}