I have tries below command and this works : ```val...
# kotlin-native
r
I have tries below command and this works :
Copy code
val startCommand = "adb shell am start -S -W $appPackage/$launchActivity -c android.intent.category.LAUNCHER -a android.intent.action.MAIN"

Runtime.getRuntime().exec("$startCommand")
But when I tried to write log into file its not:
Copy code
val writeLog = "adb logcat -d | grep --line-buffered ABC >> logcat.txt"

Runtime.getRuntime().exec("$writeLog")
m
You cannot do redirects inside
exec()
. You would need a shell to understand the
>>
And the pipes too
Or elsee you'll have to use https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#getInputStream-- and do the redirects/pipes yourself
PS: this question is not related to kotlin native, not sure where to ask, maybne #general