★ wanayoo — archive 1999 https://github.com/NativeScript/android-runtime/issues/1540Nouvelle recherche | Portail wanayoo
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

Request for an support to run commands on runtime #1540

Closed
sathish95 opened this issue Nov 8, 2019 · 1 comment
Closed

Request for an support to run commands on runtime #1540

sathish95 opened this issue Nov 8, 2019 · 1 comment
Assignees

Comments

@sathish95
Copy link

@sathish95 sathish95 commented Nov 8, 2019

I need my app to list out all logs in my android phone, but i can't able to achieve this in native script. In Java, the same will be done using below.
try { Process process = Runtime.getRuntime().exec( "logcat -c"); process = Runtime.getRuntime().exec( "logcat -f " + logFile + " *:S MyActivity:D MyActivity2:D"); } catch ( IOException e ) { e.printStackTrace(); }

@vmutafov vmutafov self-assigned this Nov 8, 2019
@NickIliev NickIliev transferred this issue from NativeScript/NativeScript Nov 13, 2019
@darind
Copy link
Member

@darind darind commented Dec 2, 2019

You can call any native method in javascript:

java.lang.Runtime.getRuntime().exec("logcat -c");
java.lang.Runtime.getRuntime().exec("logcat -f /data/data/org.nativescript.testapp/files/app/test.log \"*:S MyActivity:D MyActivity2:D\"");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.