mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
add the logcat writer
This commit is contained in:
1 parent
e34bfc50a2
commit
92228933b0
4 files changed
+31
-1
No files matched your search
@@ -70,6 +70,27 @@ object GeodeUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun writeLogcatCrashBuffer(path: String): Boolean {
|
||||
try {
|
||||
val logcatProcess = Runtime.getRuntime().exec("logcat -v brief -b crash -d")
|
||||
|
||||
val logcatFile = File(path)
|
||||
|
||||
logcatFile.outputStream().use { output ->
|
||||
logcatProcess.inputStream.use { input ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
catch (e: Exception) {
|
||||
Log.e("Geode", "Failed to write logcat crash buffer", e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun writeClipboard(text: String) {
|
||||
activity.get()?.run {
|
||||
|
||||
Reference in new issue
Block a user