文章目录 refandroid设备端(手机)推荐设置 adb 端(电脑)实操参考adb文档可能出现的问题错误的进入adb shellmore than one device/emulat
more than one device/emulator
File Transfer
(文件传输)默认
Additional settings/Developer options/Default Use configuration/File Transfer
adb install app.apk
完成安装检查设备链接情况
PS C:\Users\cxxu\Desktop\n11tp> adb devicesList of devices attachedUO7PKFNF99IR9TV4 device
执行安装
PS C:\Users\cxxu\Desktop\n11tp> adb install .\maGISk.apkPerfORMing Streamed InstallSuccess
PS C:\Users\cxxu> adbAndroid Debug Bridge version 1.0.41Version 33.0.2-8557947Installed as D:\exes\platform-tools\adb.exe....省略篇幅....(跳过,直达主题:..app intallationapp installation (see also `adb shell cmd package help`): install [-lrtsdg] [--instant] PACKAGE push a single package to the device and install it install-multiple [-lrtsdpg] [--instant] PACKAGE... push multiple APKs to the device for a single package and install them install-multi-package [-lrtsdpg] [--instant] PACKAGE... push one or more packages to the device and install them atomically -r: replace existing application -t: allow test packages -d: allow version code downgrade (debuggable packages only) -p: partial application install (install-multiple only) -g: grant all runtime permissions --abi ABI: override platform's default ABI --instant: cause the app to be installed as an ephemeral install app --no-streaming: always push APK to device and invoke Package Manager as separate steps --streaming: force streaming APK directly into Package Manager --fastdeploy: use fast deploy --no-fastdeploy: prevent use of fast deploy --force-agent: force update of deployment agent when using fast deploy --date-check-agent: update deployment agent when local version is newer and using fast deploy --version-check-agent: update deployment agent when local version has different version code and using fast deploy (See also `adb shell pm help` for more options.) uninstall [-k] PACKAGE remove this app package from the device '-k': keep the data and cache directories
根据帮助文档:
adb shell cmd package help
): adb install
来调用,因为install package是adb可执行文件提供的命令接口xaga:/sdcard $ install magisk.apkinstall: Needs 2 arguments
PS C:\Users\cxxu\Desktop\n11tp> adb install .\magisk.apkadb.exe: more than one device/emulator
初步排查:
使用adb devices
-l检查当前列表
-l
会列出设备更加详细的信息,推荐加上,可看到设备型号下面是adb 将设备识别为多模拟设备
这可能是根手机端选择的链接方式的选项有关!
从而导致虽然只连接了一台设备,却扫描出了2台设备(包括模拟设备,应该是您的选项Use USB for
的选项更换之后导致的)
PS C:\Users\cxxu> adb devicesList of devices attachedUO7PKFNF99IR9TV4 deviceemulator-5554 offline
如果向上面所讲的那样,发现了多台设备,那么考虑如下做法:
断开所有adb链接:adb kill-server
然后重新检查设备列表
PS C:\Users\cxxu> adb kill-serverPS C:\Users\cxxu> adb devices -l* daemon not running; starting now at tcp:5037* daemon started successfullyList of devices attachedUO7PKFNF99IR9TV4 device product:xaga model:22041216C device:xaga transport_id:1
您也可以选择跳过adb kill-server
,通过追加选项-s
指定设备参数
这样就不会导致设备指代不明的错误
如果您链接了多个android设备(包括虚拟设备),
adb -s xxx
xxx
代指的是设备序列号,例如上面的UO7PKFNF99IR9TV4
开发者选项相关开关为正确开启,也可能导致相应错误
PS C:\Users\cxxu\Desktop\n11tp> adb install .\magisk.apkPerforming Streamed Installadb: failed to install .\magisk.apk: Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]
来源地址:https://blog.csdn.net/xuchaoxin1375/article/details/127853819
--结束END--
本文标题: android_使用adb安装app包的详细步骤和可能遇到的问题(apk文件)
本文链接: https://www.lsjlt.com/news/433374.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-21
2023-10-28
2023-10-28
2023-10-27
2023-10-27
2023-10-27
2023-10-27
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0