The requirements
post is updated 
I have a Samsung rooted device, it can be rebooted by the command line softwarely, but ... i could not setup it to install APK softwarely... i guess yet.
UPD: succeess
[CODE lang="b4x" title="Code"]
Dim fs As Long = File.Size(dir, fn)
Dim fullPathToApkFile As String = File.Combine(dir, fn)
Dim comm As String = "cat $fullPathToApkFile | pm install -S $length".Replace("$fullPathToApkFile", fullPathToApkFile).Replace("$length", fs)
Dim res As Boolean = Super_User(comm)
......
Sub Super_User(command As String) As Boolean
Dim su As SuShell
If su.DeviceRooted Then
Dim Process As SuProcess
Process = su.Acquire("Su")
If Process.Acquired Then
Process.Execute(command)
Process.WaitForCompletion
Log("Su.Success = " & Process.Success)
Return Process.Success
Else
ToastMessageShow("Permissions error !", False)
End If
Else
ToastMessageShow("Device not rooted !", False)
End If
Return False
End Sub
[/CODE]