"gensub()" is a GNUAwk-ism that should not be used.
Change-Id: I2df89efc165c84034594b98327921f9461188a76
PID=0
FS=" "
# Need to escape the dots in the package name
- REGEX=gensub("\\.","\\\\.","g",PACKAGE)
+ #
+ # The first argument is the regular expression '\.'
+ # corresponding to a single dot character. The second
+ # argument is the replacement string, which will be '\.'
+ # for every input dot. Finally, we need to escape each
+ # backslash in the Awk strings.
+ #
+ gsub("\\.","\\.",PACKAGE)
}
# We use the fact that the 9th column of the 'ps' output
# contains the package name, while the 2nd one contains the pid
#
-$9 ~ REGEX {
+$9 ~ PACKAGE {
PID=$2
}
- ndk-gdb: check the target device's API level, and dump an error message if
it is not at least 8 (Android 2.2 a.k.a. Froyo). Fix script to properly
- remove control characters like '\r' from adb shell's output.
+ remove control characters like '\r' from adb shell's output. Also fix
+ script to work properly with OS X's BSD awk.
- ndk-build: Make AndroidManifest.xml optional. Now the build scripts will try
to look for jni/Android.mk if no manifest is found. If you don't use this,
echo "ndk-gdb will only work if your device is running Android 2.2 or higher."
exit 1
fi
+log "Device API Level: $API_LEVEL"
if [ "$API_LEVEL" -lt "8" ] ; then
echo "ERROR: ndk-gdb requires a target device running Android 2.2 (API level 8) or higher."
echo "The target device is running API level $API_LEVEL !"