adb 工具-原⽣安卓解决WiFi⽹络受限以及修改NTP服务

安装包下载地址:https://developer.android.google.cn/studio/releases/platform-tools

注:

adb kill-server      //结束adb服务连接

adb start-server   //启动adb服务

1.设置电视盒子时区为中国标准时间

2.设置开发模式开启,关于最后,一直按确认键,然后打开USB功能(否则电脑连不上电视盒子)

// 创建与xxx的设备连接

adb connect 192.168.48.xxx

// 获取adb设备列表

adb devices

// 安装apk包到电视盒子

adb install D:\apps\tv_adb.apk

说明:如要使用http,需要先写入关闭https验证的配置,再填写http服务器。然后开启飞行模式,再打开感叹号即可消失。

// 解决安卓tv原版 网络受限

1、删除默认的地址

adb shell settings delete global captive_portal_https_url

adb shell settings delete global captive_portal_http_url

2、更改为新的地址

adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204

adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204

OR

adb shell settings put global captive_portal_http_url http://captive.v2ex.co/generate_204

adb shell settings put global captive_portal_https_url https://captive.v2ex.co/generate_204

3、设置时区及NTP服务器

adb shell settings get global time_zone

adb shell settings put global time_zone Asia/Shanghai

adb shell settings put global ntp_server ntp1.aliyun.com


=========================================

列出目录下的文件和文件夹,等同于dos中的dir命令:

adb shell ls

进入文件夹,等同于dos中的cd 命令:

adb shell cd <folder>

重命名文件:

adb shell rename path/oldfilename path/newfilename

删除system/avi.apk:

adb shell rm /system/avi.apk

删除文件夹及其下面所有文件:

adb shell rm -r <folder>

移动文件:

adb shell mv path/file newpath/file

设置文件权限:

adb shell chmod 777 /system/fonts/DroidSansFallback.ttf

新建文件夹:

adb shell mkdir path/foldelname

查看文件内容:

adb shell cat <file>

查看wifi密码:

adb shell cat /data/misc/wifi/*.conf




查看连接计算机的设备:

adb devices

重启机器:

adb reboot

重启到bootloader,即刷机模式:

adb reboot bootloader

重启到recovery,即恢复模式:

adb reboot recovery

查看log:

adb logcat

终止adb服务进程:

adb kill-server

重启adb服务进程:

adb start-server

获取机器MAC地址:

adb shell  cat /sys/class/net/wlan0/address

获取CPU序列号:

adb shell cat /proc/cpuinfo

安装APK:

adb install <apkfile> //比如:adb install baidu.apk

保留数据和缓存文件,重新安装apk:

adb install -r <apkfile> //比如:adb install -r baidu.apk

安装apk到sd卡:

adb install -s <apkfile> // 比如:adb install -s baidu.apk

卸载APK:

adb uninstall <package> //比如:adb uninstall com.baidu.search

卸载app但保留数据和缓存文件:

adb uninstall -k <package> //比如:adb uninstall -k com.baidu.search

启动应用:

adb shell am start -n <package_name>/.<activity_class_name>

查看设备cpu和内存占用情况:

adb shell top


https://developer.aliyun.com/article/500613

https://lear7.cc/archives/43.html