0 Replies Latest reply on Mar 26, 2014 2:06 AM by Pietro Francesco Maggi

    rake device:android:getlog does not works under Rhodes 4

    Pietro Francesco Maggi

      I just wanted to retrieve RhoLog file from an Android device with the command:

       

      $ rake device:android:getlog

       

      as described in our docs. The command is no more there... After looking in the gem I saw the old rake task commented, tried to re-enable it and saw that it does not works as it point to the wrong folder (into device's external storage)...

       

      Usually I works with adb logcat, however is sometime handy having a look to the real log without all logcat noise. Ok, it can be filtered, however, if we have a log... I want to be able to read it :-)

       

      Looking around seems that there are a couple of possible workarounds:

       

      1. If the application is debuggable you can use the run-as command in adb shell
        adb shell run-as com.your.packagename` cp /data/data/com.your.pacakagename/
      2. You can use Android's backup function.adb backup -noapk com.your.packagenameYou will now be prompted to 'unlock your device and confirm the backup operation'. It's best NOT to provide a password, otherwise it becomes more difficult to read the data. Just click on 'backup my data'. The resulting 'backup.ab' file on your computer contains all application data in android backup format. Basically it's a compressed tar file. This page explains how you can use OpenSSL's zlib command to uncompress it. You can use the adb restore backup.db command to restore the backup.

      I tried the first one, without success. Even building my app using

       

      $ rake device:android:debug

       

      generates an APK not debugable...

      run-as com.rhomobile.rehc

      run-as: Package 'com.rhomobile.rehc' is not debuggable

       

      Why? put the question in my todo list and move on.

       

      I had more luck with adb backup (without password). Getting the debug file is easy, reading the content a bit more elaborated, however this guide helps!

      You only need to have openssl installed with ZLib included (what is included in OS X, at least up to 10.8, is not enough, "brew install openssl" helps).

       

      At the end I was able to get my preciousss "rholog.txt" <evil grin>

      However this is not an "easy to follow" procedure that I can send to someone to get rholog...

       

      0a651508-c0b1-4d0f-a4dc-17a9b7d231f2 USER03296

       

      Would be nice to fix this! :-)

       

      ~Pietro