如何克服“adb shell setprop"的属性长度限制? [英] How can I overcome the property length limitation of the "adb shell setprop"

查看:32
本文介绍了如何克服“adb shell setprop"的属性长度限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试为名称 >= 32 个字符的属性设置值时出现错误

I get an error when I try set a value for property with name >= 32 characters

adb shell setprop 01234567890123456789012345678901 VALUE

错误:

could not set property

这很好用

adb shell setprop 0123456789012345678901234567890 VALUE
adb shell getprop 0123456789012345678901234567890
VALUE

有没有办法设置名称较长的属性?

Is there any way to set properties with longer names?

推荐答案

看起来没有办法绕过这个限制.我在 android java 源代码中看到了相同的规则.

It looks like there would be no way to bypass this limitation. I see the same rules in android java sources.

public class SystemProperties
{
    public static final int PROP_NAME_MAX = 31;
    public static final int PROP_VALUE_MAX = 91;

    ...
}

这篇关于如何克服“adb shell setprop"的属性长度限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆