Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Output only reading first line #11

Closed
JmzTaylor opened this issue May 3, 2014 · 1 comment
Closed

Command Output only reading first line #11

JmzTaylor opened this issue May 3, 2014 · 1 comment

Comments

@JmzTaylor
Copy link

Using the code below will result in only the first line of the output being displayed.

 Command command = new Command(0, "cat anyfile")
 {
                @Override
                public void commandCompleted(int arg0, int arg1) {

                }

                @Override
                public void commandOutput(int arg0, String line) {
                                Log.i("stuff: ", line);
                            }

                @Override
                public void commandTerminated(int arg0, String arg1) {

                }
        }
        RootTools.getShell(true).add(command);
@Stericson
Copy link
Owner

This works for me using the most update version. It looks to me like you are using an outdated version.

Example:

    Command cmd = new Command(0, "cat /default.prop") {
        @Override
        public void commandOutput(int i, String s)
        {
            Log.e("CAT FILE", s);
        }

        @Override
        public void commandTerminated(int i, String s)
        {

        }

        @Override
        public void commandCompleted(int i, int i2)
        {

        }
    };

    try
    {
        RootTools.getShell(true).add(cmd);
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }

RESULT:

05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ #
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ # ADDITIONAL_DEFAULT_PROPERTIES
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ #
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ ro.product.locale.region=GB
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ telephony.sms.shift_table=1
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ persist.sys.timezone=Europe/London
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ keyguard.no_require_sim=false
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ ro.sf.lcd_density=240
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ panel.physicalWidthmm=52
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ panel.physicalHeightmm=89
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ ro.opengles.version=131072
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ gsm.net.interface=rmnet0
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ persist.service.crashlog.enable=1
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ persist.system.at-proxy.mode=0
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ ro.secure=1
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ ro.allow.mock.location=0
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ ro.debuggable=0
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ wifi.interface=wlan0:0
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ persist.ril-daemon.disable=0
05-03 23:24:32.309 2343-2343/? E/CAT FILE﹕ persist.sys.usb.config=mtp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants