Android Question Can i execute adb commands via B4A?

Alhootti

Active Member
im using this commands via adb to set Time & date to my adenoid Tvbox , it is working successfully.
B4X:
adb root
adb shell date 102902012020.55

how i can use these adb commands through B4A to set time & date?
 

Attachments

  • adb.jpg
    adb.jpg
    30.1 KB · Views: 26
Solution
yes it is rooted.
i tried this code but there is no result .
how i can utilize this command (adb shell date 102902012020.55) in the following code:
B4X:
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
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)
Msgbox(StdOut.tostring, "")
Thanks @Erel
it is working now perfectly...

Alhootti

Active Member
yes it is rooted.
i tried this code but there is no result .
how i can utilize this command (adb shell date 102902012020.55) in the following code:
B4X:
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
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)
Msgbox(StdOut.tostring, "")
 
Upvote 0

Alhootti

Active Member
yes it is rooted.
i tried this code but there is no result .
how i can utilize this command (adb shell date 102902012020.55) in the following code:
B4X:
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
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)
Msgbox(StdOut.tostring, "")
Thanks @Erel
it is working now perfectly
B4X:
File.WriteString(File.DirInternalCache, "command", "modprobe cifs" & CRLF & "modprobe aufs" & CRLF & "date 102902012020.55" & CRLF & "exit") 'Any commands via crlf, and exit at end
 
Upvote 0
Solution
Top