安卓11 发送adb指令给app调用安装方法和删除方法,去安装证书和删除证书
时间: 2024-01-18 14:01:48 浏览: 33
可以通过以下方式使用adb命令安装和删除证书:
1. 安装证书:
```
adb push <path-to-certificate>.crt /sdcard/
adb shell settings put secure user_setup_complete 0
adb shell am start -n "com.android.settings/.Settings\$SecuritySettingsActivity"
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input text "test"
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input text "test"
adb shell input keyevent 20 && adb shell input keyevent 23
adb shell input keyevent 22 && adb shell input keyevent 23
adb shell input keyevent 22 && adb shell input keyevent 23
adb shell input keyevent 4 && adb shell input keyevent 4
adb shell input keyevent 3
adb shell pm uninstall -k --user 0 "com.android.certinstaller"
adb shell settings put secure user_setup_complete 1
```
2. 删除证书:
```
adb shell settings put secure user_setup_complete 0
adb shell pm uninstall -k --user 0 "com.android.certinstaller"
adb shell settings put secure user_setup_complete 1
```
在执行上述命令之前,请确保在设备上启用了开发人员选项。此外,有些设备可能需要通过root权限才能够执行这些命令。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)