I want to debug a program on a Android device, but debug failed with the error "No such file or directory: ${env}", it seems like that codelldb didn't push target file to the device.
here is my launch.json:
{
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Remote CMake Targets",
"program": "${command:cmake.launchTargetPath}",
// Run this on another terminal: adb shell "cd /data/local/tmp; ./lldb-server p --server --listen '*:9999'"
"initCommands": [
"platform select remote-android",
"platform connect connect://localhost:9999",
"settings set target.inherit-env false",
"platform shell touch ${command:cmake.buildTargetName}"
],
"args": [
// args to the program
],
"cwd": "/data/local/tmp/test",
"env": {
"LD_LIBRARY_PATH": "/data/local/tmp/test"
}
},
{
"name": "CMake Targets",
"type": "cppdbg",
"request": "launch",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [
// args to the program
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "${env:PATH}:${command:cmake.getLaunchTargetDirectory}"
},
{
"name": "OTHER_VALUE",
"value": "Something something"
}
],
"externalConsole": false,
"MIMode": "gdb"
}
]
}
OS: windows 11 VSCode version: 1.85.2 CodeLLDB version: 1.10.0 Compiler: clang Debuggee: android arm64-v8a
I want to debug a program on a Android device, but debug failed with the error "No such file or directory: ${env}", it seems like that codelldb didn't push target file to the device.
here is my launch.json: { "configurations": [ { "type": "lldb", "request": "launch", "name": "Remote CMake Targets", "program": "${command:cmake.launchTargetPath}", // Run this on another terminal: adb shell "cd /data/local/tmp; ./lldb-server p --server --listen '*:9999'" "initCommands": [ "platform select remote-android", "platform connect connect://localhost:9999", "settings set target.inherit-env false", "platform shell touch ${command:cmake.buildTargetName}" ], "args": [ // args to the program ], "cwd": "/data/local/tmp/test", "env": { "LD_LIBRARY_PATH": "/data/local/tmp/test" } }, { "name": "CMake Targets", "type": "cppdbg", "request": "launch", // Resolved by CMake Tools: "program": "${command:cmake.launchTargetPath}", "args": [ // args to the program ], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [ { "name": "PATH", "value": "${env:PATH}:${command:cmake.getLaunchTargetDirectory}" }, { "name": "OTHER_VALUE", "value": "Something something" } ], "externalConsole": false, "MIMode": "gdb" } ] }
Verbose log