## Android Debugging with Visual Studio Code
####
android
#### Python
```shell
# NDK r23c,24gdb
/Applications/AndroidNDK8568313.app/Contents/NDK/prebuilt/darwin-x86_64/bin/gdb
```
####
##### task.vscodetask.json
```json
{
"label": "Forward_Debug_Port",
"type": "shell",
"command": "adb",
"args": [
"forward",
"tcp:5039",
"tcp:5039"
],
"presentation": {
"reveal": "never"
},
"problemMatcher": []
}
```
#### .vscodelaunch.json
+ osx Debugger executable '/usr/local/bin/gdb' is not signed.
```json
{
"name": "Remote GDB",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Build_Android",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/android/build_arm64-v8a/hello",
"additionalSOLibSearchPath": "${workspaceRoot}",
"miDebuggerServerAddress": "172.19.101.17:5039",
"windows": {
"miDebuggerPath": "",
"MIMode": "gdb"
},
"osx": {
"miDebuggerPath": "/Applications/AndroidNDK8568313.app/Contents/NDK/prebuilt/darwin-x86_64/bin/gdb",
"MIMode": "gdb"
}
}
```
####
```shell
# gdbserver
export ANROID_NDK="/Applications/AndroidNDK8568313.app/Contents/NDK"
export ANROID_NDK="/opt/ndk/android-ndk-r23b"
adb push ${ANROID_NDK}/prebuilt/android-arm64/gdbserver/gdbserver /data/local/tmp
# adbforward tcp
adb forward tcp:5039 tcp:5039
#
/data/local/tmp/gdbserver :5039 ./hello
```
####
+ [Android gdb Visual Studio Code ](https://shengyu7697.github.io/android-debugging-with-vscode/)
+ [Android Debugging with Visual Studio Code](https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/android-debugging-with-visual-studio-code-r4820/)
+ [How do I use lldb to debug C++ code on Android on command line](https://stackoverflow.com/questions/53733781/how-do-i-use-lldb-to-debug-c-code-on-android-on-command-line)