mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 06:31:11 +00:00
fix(android): use absolute logcat path
Fix Android CodeQL relative path command finding in debug log collection.
This commit is contained in:
parent
59a4d7fb06
commit
29a34e0a4d
1 changed files with 3 additions and 1 deletions
|
|
@ -6,6 +6,8 @@ import ai.openclaw.app.gateway.DeviceIdentityStore
|
|||
import ai.openclaw.app.gateway.GatewaySession
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
|
||||
private const val LOGCAT_PATH = "/system/bin/logcat"
|
||||
|
||||
class DebugHandler(
|
||||
private val appContext: Context,
|
||||
private val identityStore: DeviceIdentityStore,
|
||||
|
|
@ -80,7 +82,7 @@ class DebugHandler(
|
|||
val logResult = try {
|
||||
val tmpFile = java.io.File(appContext.cacheDir, "debug_logs.txt")
|
||||
if (tmpFile.exists()) tmpFile.delete()
|
||||
val pb = ProcessBuilder("logcat", "-d", "-t", "200", "--pid=$pid")
|
||||
val pb = ProcessBuilder(LOGCAT_PATH, "-d", "-t", "200", "--pid=$pid")
|
||||
pb.redirectOutput(tmpFile)
|
||||
pb.redirectErrorStream(true)
|
||||
val proc = pb.start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue