百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 编程字典 > 正文

查看安卓系统属性与修改系统属性

toyiye 2024-06-21 12:19 17 浏览 0 评论

大家好,我是公众号3分钟学堂的郭立员~

前言

对于安卓系统属性的查看和修改需要命令行工具 getprop 和 setprop。

getprop 获取系统属性

setprop 修改系统属性

涉及到几个文件:

/default.prop
/system/build.prop


研究这个是在找adb相关资料的时候找到的,发现只运行getprop 命令时,会输出很多系统属性。

Import "zm.luae"
TracePrint zm.Execute("getprop")

输出结果:

[ack-trace-file]: [/data/anr/traces.txt]
[app.setupwizard.disable]: [0]
[dalvik.vm.appimageformat]: [lz4]
[dalvik.vm.checkjni]: [false]
[dalvik.vm.dex2oat-Xms]: [64m]
[dalvik.vm.dex2oat-Xmx]: [512m]
[dalvik.vm.heapgrowthlimit]: [192m]
[dalvik.vm.heapmaxfree]: [8m]
[dalvik.vm.heapminfree]: [512k]
[dalvik.vm.heapsize]: [512m]
[dalvik.vm.heapstartsize]: [16m]
[dalvik.vm.heaptargetutilization]: [0.75]
[dalvik.vm.image-dex2oat-Xms]: [64m]
[dalvik.vm.image-dex2oat-Xmx]: [64m]
[dalvik.vm.isa.x86.features]: [default]
[dalvik.vm.isa.x86.variant]: [x86]
[dalvik.vm.isa.x86_64.features]: [default]
[dalvik.vm.isa.x86_64.variant]: [silvermont]
[dalvik.vm.lockprof.threshold]: [500]
[dalvik.vm.stack-trace-file]: [/data/anr/traces.txt]
[dalvik.vm.usejit]: [true]
[dalvik.vm.usejitprofiles]: [true]
[debug.atrace.tags.enableflags]: [0]
[debug.force_rtl]: [0]
[debug.sf.nobootanimation]: [1]
[dev.bootcomplete]: [1]
[gsm.current.phone-type]: [1]
[gsm.network.type]: [Unknown]
[gsm.operator.alpha]: []
[gsm.operator.iso-country]: []
[gsm.operator.isroaming]: [false]
[gsm.operator.numeric]: []
[gsm.sim.operator.alpha]: []
[gsm.sim.operator.iso-country]: []
[gsm.sim.operator.numeric]: []
[gsm.sim.state]: [NOT_READY]
[init.svc.adbd]: [running]
[init.svc.audioserver]: [running]
[init.svc.cameraserver]: [running]
[init.svc.debuggerd]: [running]
[init.svc.debuggerd64]: [running]
[init.svc.drm]: [running]
[init.svc.gatekeeperd]: [running]
[init.svc.healthd]: [running]
[init.svc.installd]: [running]
[init.svc.keystore]: [running]
[init.svc.ldinit]: [running]
[init.svc.lmkd]: [running]
[init.svc.logd]: [running]
[init.svc.logd-reinit]: [stopped]
[init.svc.media]: [running]
[init.svc.mediacodec]: [running]
[init.svc.mediadrm]: [running]
[init.svc.mediaextractor]: [running]
[init.svc.nativebridge]: [stopped]
[init.svc.netd]: [running]
[init.svc.ril-daemon]: [running]
[init.svc.servicemanager]: [running]
[init.svc.su_daemon]: [running]
[init.svc.surfaceflinger]: [running]
[init.svc.ueventd]: [running]
[init.svc.vold]: [running]
[init.svc.zygote]: [running]
[init.svc.zygote_secondary]: [running]
[keyguard.no_require_sim]: [true]
[media.sf.extractor-plugin]: [libffmpeg_extractor.so]
[media.sf.hwaccel]: [1]
[media.sf.omx-plugin]: [libffmpeg_omx.so]
[net.bt.name]: [Android]
[net.change]: [net.dns3]
[net.dns1]: [192.168.31.1]
[net.dns2]: [119.29.29.29]
[net.dns3]: [114.114.114.114]
[net.hostname]: [android-55b499c67c51e632]
[net.qtaguid_enabled]: [0]
[net.tcp.default_init_rwnd]: [60]
[persist.imei]: [869394025762798]
[persist.logd.logpersistd]: []
[persist.logd.logpersistd.buffer]: []
[persist.rtc_local_time]: [1]
[persist.sys.build.time]: [1654223609]
[persist.sys.country]: [CN]
[persist.sys.dalvik.vm.lib.2]: [libart.so]
[persist.sys.gps.lpp]: []
[persist.sys.language]: [zh]
[persist.sys.locale]: [zh-CN]
[persist.sys.localevar]: []
[persist.sys.nativebridge]: [1]
[persist.sys.profiler_ms]: [0]
[persist.sys.strictmode.disable]: [1]
[persist.sys.strictmode.visual]: [0]
[persist.sys.timezone]: [Asia/Shanghai]
[persist.sys.usb.config]: [none]
[persist.sys.webview.vmsize]: [169343248]
[pm.dexopt.ab-ota]: [speed-profile]
[pm.dexopt.bg-dexopt]: [speed-profile]
[pm.dexopt.boot]: [verify-profile]
[pm.dexopt.core-app]: [speed]
[pm.dexopt.first-boot]: [interpret-only]
[pm.dexopt.forced-dexopt]: [speed]
[pm.dexopt.install]: [interpret-only]
[pm.dexopt.nsys-library]: [speed]
[pm.dexopt.shared-apk]: [speed]
[ro.adb.secure]: [1]
[ro.alarm.volume.adjustable]: [true]
[ro.allow.mock.location]: [0]
[ro.arch]: [x86]
[ro.baseband]: [unknown]
[ro.board.platform]: [aosp-user]
[ro.boot.console]: [tty0]
[ro.boot.selinux]: [permissive]
[ro.boot.serialno]: [00d21e88]
[ro.bootimage.build.date]: [Fri Jun 3 10:08:51 CST 2022]
[ro.bootimage.build.date.utc]: [1654222131]
[ro.bootimage.build.fingerprint]: [google/android_x86_64/x86_64:7.1.2/N2G47O/327:user/release-keys]
[ro.bootloader]: [unknown]
[ro.bootmode]: [unknown]
[ro.build.characteristics]: [tablet]
[ro.build.date]: [Fri Jun  3 10:08:51 CST 2022]
[ro.build.date.utc]: [1654222131]
[ro.build.description]: [android_x86_64-user 7.1.2 N2G47O 327 release-keys]
[ro.build.display.id]: [N2G47O]
[ro.build.fingerprint]: [google/android_x86_64/x86_64:7.1.2/N2G47O/327:user/release-keys]
[ro.build.flavor]: [aosp-user]
[ro.build.host]: [UBNX]
[ro.build.id]: [N2G47O]
[ro.build.product]: [aosp]
[ro.build.tags]: [release-keys]
[ro.build.time]: [1654223609]
[ro.build.type]: [user]
[ro.build.user]: [build]
[ro.build.version.all_codenames]: [REL]
[ro.build.version.base_os]: []
[ro.build.version.codename]: [REL]
[ro.build.version.incremental]: [327]
[ro.build.version.preview_sdk]: [0]
[ro.build.version.release]: [7.1.2]
[ro.build.version.sdk]: [25]
[ro.build.version.security_patch]: [2017-10-05]
[ro.carrier]: [unknown]
[ro.com.android.dataroaming]: [true]
[ro.com.android.dateformat]: [MM-dd-yyyy]
[ro.config.alarm_alert]: [Alarm_Classic.ogg]
[ro.config.notification_sound]: [OnTheHunt.ogg]
[ro.config.sync]: [yes]
[ro.crypto.state]: [unsupported]
[ro.dalvik.vm.isa.arm]: [x86]
[ro.dalvik.vm.isa.arm64]: [x86_64]
[ro.dalvik.vm.native.bridge]: [libnb.so]
[ro.debuggable]: [1]
[ro.device_owner]: [false]
[ro.enable.native.bridge.exec]: [1]
[ro.enable.native.bridge.exec64]: [1]
[ro.hardware]: [android_x86_64]
[ro.hwui.drop_shadow_cache_size]: [4.0]
[ro.hwui.gradient_cache_size]: [0.8]
[ro.hwui.layer_cache_size]: [32.0]
[ro.hwui.path_cache_size]: [24.0]
[ro.hwui.text_large_cache_height]: [1024]
[ro.hwui.text_large_cache_width]: [2048]
[ro.hwui.text_small_cache_height]: [512]
[ro.hwui.text_small_cache_width]: [1024]
[ro.hwui.texture_cache_flushrate]: [0.4]
[ro.hwui.texture_cache_size]: [48.0]
[ro.opengles.max]: [196609]
[ro.opengles.version]: [196609]
[ro.product.board]: [V1938CT]
[ro.product.brand]: [vivo]
[ro.product.cpu.abi]: [x86_64]
[ro.product.cpu.abilist]: [x86_64,x86,arm64-v8a,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [x86_64,arm64-v8a]
[ro.product.device]: [aosp]
[ro.product.locale]: [en-US]
[ro.product.locale.language]: [zh]
[ro.product.locale.region]: [CN]
[ro.product.manufacturer]: [vivo]
[ro.product.model]: [V1938CT]
[ro.product.name]: [V1938CT]
[ro.radio.use-ppp]: [yes]
[ro.revision]: [0]
[ro.ril.gprsclass]: [10]
[ro.ril.hsxpa]: [1]
[ro.runtime.firstboot]: [1704614344671]
[ro.secure]: [1]
[ro.serialno]: [00d21e88]
[ro.setupwizard.mode]: [DISABLED]
[ro.sf.lcd_density]: [320]
[ro.simulated.phone]: [false]
[ro.wifi.channels]: []
[ro.zygote]: [zygote64_32]
[security.perf_harden]: [1]
[selinux.reload_policy]: [1]
[service.bootanim.exit]: [1]
[status.battery.level]: [5]
[status.battery.level_raw]: [50]
[status.battery.level_scale]: [9]
[status.battery.state]: [Slow]
[sys.boot_completed]: [1]
[sys.logbootcomplete]: [1]
[sys.media.vdec.drop]: [0]
[sys.sysctl.extra_free_kbytes]: [10800]
[sys.sysctl.tcp_def_init_rwnd]: [60]
[sys.usb.config]: [adb]
[sys.usb.configfs]: [0]
[sys.usb.state]: [adb]
[vold.has_adoptable]: [1]
[vold.post_fs_data_done]: [1]


进一步查找发现这些系统属性保存在上面提到的文件:

/default.prop
/system/build.prop

在上面的输出结果中,格式是这样的:[key]:[value]

key是属性名,value是属性值

getprop的用法:

getprop [key] 取得对应的key的属性值

比如获取手机品牌:

Import "zm.luae"
TracePrint zm.Execute("getprop ro.product.brand")


//输出结果:vivo


setprop的用法:

setprop [key] [value] 设置指定key的属性值。

如修改模拟器定位:

Import "zm.luae"
TracePrint zm.Execute("getprop call.locate 117,29")


需要注意一般属性名中有ro.的属性,使用setprop修改只是临时修改,ro的意思是read only(只读)。

相关文章:

整理了一下雷电模拟器的adb命令

正文完=

相关推荐

为何越来越多的编程语言使用JSON(为什么编程)

JSON是JavascriptObjectNotation的缩写,意思是Javascript对象表示法,是一种易于人类阅读和对编程友好的文本数据传递方法,是JavaScript语言规范定义的一个子...

何时在数据库中使用 JSON(数据库用json格式存储)

在本文中,您将了解何时应考虑将JSON数据类型添加到表中以及何时应避免使用它们。每天?分享?最新?软件?开发?,Devops,敏捷?,测试?以及?项目?管理?最新?,最热门?的?文章?,每天?花?...

MySQL 从零开始:05 数据类型(mysql数据类型有哪些,并举例)

前面的讲解中已经接触到了表的创建,表的创建是对字段的声明,比如:上述语句声明了字段的名称、类型、所占空间、默认值和是否可以为空等信息。其中的int、varchar、char和decimal都...

JSON对象花样进阶(json格式对象)

一、引言在现代Web开发中,JSON(JavaScriptObjectNotation)已经成为数据交换的标准格式。无论是从前端向后端发送数据,还是从后端接收数据,JSON都是不可或缺的一部分。...

深入理解 JSON 和 Form-data(json和formdata提交区别)

在讨论现代网络开发与API设计的语境下,理解客户端和服务器间如何有效且可靠地交换数据变得尤为关键。这里,特别值得关注的是两种主流数据格式:...

JSON 语法(json 语法 priority)

JSON语法是JavaScript语法的子集。JSON语法规则JSON语法是JavaScript对象表示法语法的子集。数据在名称/值对中数据由逗号分隔花括号保存对象方括号保存数组JS...

JSON语法详解(json的语法规则)

JSON语法规则JSON语法是JavaScript对象表示法语法的子集。数据在名称/值对中数据由逗号分隔大括号保存对象中括号保存数组注意:json的key是字符串,且必须是双引号,不能是单引号...

MySQL JSON数据类型操作(mysql的json)

概述mysql自5.7.8版本开始,就支持了json结构的数据存储和查询,这表明了mysql也在不断的学习和增加nosql数据库的有点。但mysql毕竟是关系型数据库,在处理json这种非结构化的数据...

JSON的数据模式(json数据格式示例)

像XML模式一样,JSON数据格式也有Schema,这是一个基于JSON格式的规范。JSON模式也以JSON格式编写。它用于验证JSON数据。JSON模式示例以下代码显示了基本的JSON模式。{"...

前端学习——JSON格式详解(后端json格式)

JSON(JavaScriptObjectNotation)是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScriptProgrammingLa...

什么是 JSON:详解 JSON 及其优势(什么叫json)

现在程序员还有谁不知道JSON吗?无论对于前端还是后端,JSON都是一种常见的数据格式。那么JSON到底是什么呢?JSON的定义...

PostgreSQL JSON 类型:处理结构化数据

PostgreSQL提供JSON类型,以存储结构化数据。JSON是一种开放的数据格式,可用于存储各种类型的值。什么是JSON类型?JSON类型表示JSON(JavaScriptO...

JavaScript:JSON、三种包装类(javascript 包)

JOSN:我们希望可以将一个对象在不同的语言中进行传递,以达到通信的目的,最佳方式就是将一个对象转换为字符串的形式JSON(JavaScriptObjectNotation)-JS的对象表示法...

Python数据分析 只要1分钟 教你玩转JSON 全程干货

Json简介:Json,全名JavaScriptObjectNotation,JSON(JavaScriptObjectNotation(记号、标记))是一种轻量级的数据交换格式。它基于J...

比较一下JSON与XML两种数据格式?(json和xml哪个好)

JSON(JavaScriptObjectNotation)和XML(eXtensibleMarkupLanguage)是在日常开发中比较常用的两种数据格式,它们主要的作用就是用来进行数据的传...

取消回复欢迎 发表评论:

请填写验证码