Hi All,
In my android test project, I am imply read the logcat using adb
command like,
public StringBuilder log=new StringBuilder();
public String line="";
public String temp="";
public void testSolo() throws Exception {
String baseCommand = "logcat -v time";
baseCommand += " ActivityManager:I "; // Info for my app
baseCommand += " *:S "; // Silence others
try {
Process logReaderProcess =
Runtime.getRuntime().exec(baseCommand);
BufferedReader bufferedReader = new
BufferedReader(
new
InputStreamReader(logReaderProcess.getInputStream()));
while ((line =
bufferedReader.readLine()) != null) {
log.append(line);
}
}
catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
but, here in string line I always get null value,
while the same thing always run in the android activity's onCreate() .
I don't understand why this happen?
Same thing runs in activity class and not in the android test project.
I also add use -permission for READ_LOGS and WRITE_EXTERNAL_STORAGE in
manifest.xml file.
Is there anybody knows how it works or what happens?
Thanks in advance.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en