Я тут погуглил и понял, что ко всему железу можно обращаться с терминала (к блюпупу тоже) через Busybox (и без него).
Что бы проверть то, как Unity умеет создавать процессы я написал скрипт:
using UnityEngine;
using System;
using System.Collections;
using System.Diagnostics;
public class Call : MonoBehaviour
{
// Use this for initialization
// private Shell shell;
public bool run = false;
public string program = "";
public string command = "";
public string ret = "";
public string inp = "";
public bool input = false;
public bool processing = false;
private Process p;
//private ProcessStartInfo info;
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if (run) {
if (!processing) {
try {
ret = "";
p = new Process ();
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
//p.StartInfo.RedirectStandardError = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = program;
p.Start ();
//p.WaitForExit();
processing = true;
p.StandardInput.WriteLine (command);
p.StandardInput.Write("\n");
} catch (Exception e) {
ret = e.Message;
}
} else {
if (!p.HasExited) {
ret += p.StandardOutput.ReadToEnd ();// + p.StandardError.ReadToEnd();
} else {
run = false;
processing = false;
}
}
}
}
void OnGUI ()
{
if (GUI.Button (new Rect (10, 10, Screen.width - 20, 32), "Press for run")) {
run = true;
}
program = GUI.TextArea (new Rect (10, 42 + 8, Screen.width / 2 - 20, 32), program);
command = GUI.TextArea (new Rect (Screen.width / 2 + 10, 42 + 8, Screen.width / 2 - 20, 32), command);
GUI.TextField (new Rect (10, 90, Screen.width - 20, Screen.height - 90), ret);
}
}
(вешаем на камеру )
Имхо кастыль, но работает (Huawei ascend), может у кого нет.
UPD. SU не смог вызвать - повис.
UPD. не могу вызвать утилиты busybox, сам он вызывается, но microcom - не выдает ничего, может че с stdout.
Короче, почему-то нельзя выполнить функции с параметрами, например не могу вызвать cmd help.
делал по подобию
http://stackoverflow.com/questions/6...ide-su-process
Помогите!