LogCat View trouble on AIDE -IDE Android

1.1k views Asked by At

after I run any application on my phone, using free version of AIDE -IDE Android, everytime I view LogCat, I get the same message : " run the app to see the log output ".! Here is the following screenshot :(https://i.stack.imgur.com/uLORU.png) Is LogCat free on AIDE-IDE Google play app ? Thank you for your attention.

3

There are 3 answers

2
BenjaminWegener On

It's free as far as i know, but you need root access in order for log to work. Besides: it doesn't work from time to time with root either.

Another option: use following function to log to local file:

public void appendLog(String text)
// https://stackoverflow.com/a/6209739
{       
File logFile = new File("sdcard/log.file");
if (!logFile.exists())
{
    try
    {
        logFile.createNewFile();
    } 
    catch (IOException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
try
{
    //BufferedWriter for performance, true to set append to file flag
    BufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true)); 
    buf.append(text);
    buf.newLine();
    buf.flush();
    buf.close();
}
catch (IOException e)
{
    // TODO Auto-generated catch block
    e.printStackTrace();
}
}

Use it like this:

try{
   // your code goes here
}catch (Exception e){
   appendLog(e.getMessage());
}

You need to add permission for writing_external_storage in Manifest.

0
Denys Plaud On

I found this way, as shown below, using Log.getStackTraceString(Exception e), to solve my LogCat View trouble on AIDE-IDE Android. The only remaining question is why there is no display of Log.e (TAG,"Exception ",e) ? Thank you for your attention. Code of MainActivity (https://i.stack.imgur.com/Dqfc5.png)

0
DiLDoST On

There is no problem with your code. However the problem is with AIDE version your using. Am using the Pro and Logcat is working fine for me