adb shell 命令获取设备参数信息

adb shell prop获取所有的参数;

adb shell cat /system/build.prop

 
private static String getSystemProperty(String key, String defaultValue) {
        try {
                Class clz = Class.forName("android.os.SystemProperties");
                Method get = clz.getMethod("get", String.class, String.class);
                return (String)get.invoke(clz, key, defaultValue);
        } catch (ClassNotFoundException e) {
        } catch (NoSuchMethodException e) {
        } catch (IllegalAccessException e) {
        } catch (IllegalArgumentException e) {
        } catch (InvocationTargetException e) {
        }
        return defaultValue;
}

你可能感兴趣的:(Android,善其事利其器)