Hi,
i want to send a command into shell on my device i use this:
i can send a command into "Command" variable?
for example, to see a list of the root file and folder?
cd /
ls -lrt
thanks
i want to send a command into shell on my device i use this:
B4X:
Sub rShellExecute (Command As String)
Dim Runner As String
Dim StdOut, StdErr As StringBuilder
StdOut.Initialize
StdErr.Initialize
Dim Result As Int
Dim Ph As Phone
Runner = File.Combine(File.DirInternalCache, "Runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "Runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "modprobe cifs" & CRLF & "modprobe aufs" & CRLF & "exit") 'Any commands via crlf, and exit at end
Result = Ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
Log(Runner)
Log(StdOut.tostring)
Log(StdErr.tostring)
i can send a command into "Command" variable?
for example, to see a list of the root file and folder?
cd /
ls -lrt
thanks