2014-11-03 6 views

Antwort

6

Ich ging mit popen wie in der Antwort auf https://stackoverflow.com/a/478960/2833126 ausführlich beschrieben, um getprop zu laufen. Etwas wie

std::string command = "getprop ro.product.model"; 
FILE* file = popen(command.c_str(), "r"); 
if (!file) { 
    // error 
} 
// read the property value from file 
pclose(file);