linux安卓抓log

1,安卓log   cpp log

app

batterysecret   cpp名字?

adb shell logcat|findstr batterysecret

adb shell getprop ro.product.name

adb shell getprop | grep region   (| grep获取关键字)

int xm_is_eu_model(void)
{
    int rc = 0, fd;
    int is_eu_model = 0, bytes = 0;
    char buffer[32] = {0,};

    if (property_get("ro.product.name", product_name, NULL) > 0) {
        KLOG_ERROR(LOG_TAG,"test product_name: '%s'", product_name);
        if (!strncmp(product_name, "dada_global", strlen("dada_global"))) {
            KLOG_ERROR(LOG_TAG,"xm_is_eu_model: dada_global.\n");
            is_eu_model = 3;

        } else if (!strncmp(product_name, "dada", strlen("dada"))) {
            KLOG_ERROR(LOG_TAG,"xm_is_eu_model: dada_cn.\n");
            is_eu_model = 6;
        } else if (!strncmp(product_name, "dada_eea", strlen("dada_eea"))) {
            KLOG_ERROR(LOG_TAG,"xm_is_eu_model: dada_eea.\n");
            is_eu_model = 9;
        }
    }

    if (is_eu_model) {
        fd = open(IS_EU_MODEL_PATH, O_RDWR);
        if (fd < 0) {
            KLOG_ERROR(LOG_TAG,"Unable to open: '%s'", IS_EU_MODEL_PATH);
            return fd;
        }
        bytes = snprintf(buffer, sizeof(buffer), "%d\n", 1);
        rc = write(fd, &buffer, bytes);
        if (fd < 0) {
            KLOG_ERROR(LOG_TAG,"Unable to write: '%s'", IS_EU_MODEL_PATH);
            close(fd);
            return rc;
        }
        KLOG_ERROR(LOG_TAG,"xm_is_eu_model: set is_eu_model true.\n");
        close(fd);
    }

    return is_eu_model;
}

2,开串口log

不一定通用

*#*#27274#*#*

fastboot oem p2u on

fastboot oem uart-enable 1

2,getprop

getprop | grep battery

这是一条命令,用于在安卓手机上获取电池的属性。其中,“getprop”是获取属性的命令,“|”是管道符号,用于将前面命令的输出作为后面命令的输入,“grep battery”是用于过滤包含“battery”字符串的属性。这个命令的作用是显示所有包含“battery”的属性。

4,无线连接adb

安卓自己的无线调试功能

连接一个网络

我的设备-全部参数-os版本五次  进开发者模式

更多设置-开发者选项-无线调试-使用配对码配对设备

会出现例如:

ip地址端口192.168.137.187:42567

wlan配对码  051360

配对ip地址端口   192.168.137.173:38305

如下:

adb pair 192.168.137.187:38305 051360

adb connect 192.168.137.187:42567

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值