Ensure that logcat command exits properly
This commit is contained in:
parent
ac9a9de69a
commit
f1546d3d3e
@ -17,15 +17,14 @@ class DebugInformationDumper {
|
|||||||
"kvaesitso-log-${df.format(Date(System.currentTimeMillis()))}"
|
"kvaesitso-log-${df.format(Date(System.currentTimeMillis()))}"
|
||||||
)
|
)
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
val timeout = System.currentTimeMillis() + 5000
|
|
||||||
val fos = file.outputStream().writer()
|
val fos = file.outputStream().writer()
|
||||||
fos.write("Device: ${Build.DEVICE}\n")
|
fos.write("Device: ${Build.DEVICE}\n")
|
||||||
fos.write("SDK version: ${Build.VERSION.SDK_INT}\n")
|
fos.write("SDK version: ${Build.VERSION.SDK_INT}\n")
|
||||||
fos.write("====================================\n")
|
fos.write("====================================\n")
|
||||||
val input =
|
val input =
|
||||||
Runtime.getRuntime().exec("/system/bin/sh -c logcat").inputStream.bufferedReader()
|
Runtime.getRuntime().exec("/system/bin/logcat -d").inputStream.bufferedReader()
|
||||||
var line = input.readLine()
|
var line = input.readLine()
|
||||||
while (line != null && System.currentTimeMillis() < timeout) {
|
while (line != null) {
|
||||||
line = input.readLine()
|
line = input.readLine()
|
||||||
fos.write("$line\n")
|
fos.write("$line\n")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user