I use ndk-gdb of android-ndk-r9d-linux-x86 in ubuntu 12.04 to debug the android native application "hello-jni", but it receive this error.
WARNING: The shell running this script isn't bash. Although we try to avoid bashism in scripts, things can happen.
.../adt-bundle-linux-x86-20140321/android-ndk-r9d/ndk-gdb: 143: .../adt-bundle-linux-x86-20140321/android-ndk-r9d/ndk-gdb: Bad substitution
.../adt-bundle-linux-x86-20140321/android-ndk-r9d/ndk-gdb: 555: [: 1: unexpected operator
.../adt-bundle-linux-x86-20140321/android-ndk-r9d/ndk-gdb: 771: [: armeabi-v7a: unexpected operator
but the android-ndk-r8e-linux-x86 is ok, i wonder why? Thanks.
I believe 'ndk-gdb' has been deprecated in favor of 'ndk-gdb.py' (although this has not been widely advertised, IMO.) Using r9d, I had the same problem you reported above, but the python version worked without issue.
WARNING: The shell running this script isn't bash. Although we try to avoid bashism in scripts, things can happen.
--- This means you are using something like dash.
Change /bin/sh to /bin/bash will solve the warning and the "bad substitution" problem.
来源:https://stackoverflow.com/questions/22854152/error-with-ndk-gdb-of-android-ndk-r9d-linux-x86-in-ubuntu-12-04