拓展:故障排查指南
(1) 问题:为检测到手机或模拟器
- 解决:手机开启usb调试
(2) 安装HBuilder基座App失败
10:33:50.398 正在编译中...
10:34:09.363 DONE Build complete. Watching for changes...
10:34:09.364 项目 'jack-edge-app' 编译成功。
10:34:09.969 正在建立手机连接...
10:34:09.984 正在安装手机端HBuilder调试基座...
10:34:12.243 /Applications/HBuilderX.app/Contents/HBuilderX/plugins/launcher/base/android_base.apk: 1 file pushed. 34.3 MB/s (41244291 bytes in 1.147s)
10:34:12.264 avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:fuse:s0 tclass=file permissive=0
10:34:12.285 System server has no access to read file context u:object_r:fuse:s0 (from path /sdcard/android_base.apk, context u:r:system_server:s0)
10:34:12.306 Error: Unable to open file: /sdcard/android_base.apk
10:34:12.331 Consider using a file under /data/local/tmp/
10:34:12.352 Error: Can't open file: /sdcard/android_base.apk
10:34:12.375 Exception occurred while executing 'install':
10:34:12.400 java.lang.IllegalArgumentException: Error: Can't open file: /sdcard/android_base.apk
10:34:12.422 at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:519)
10:34:12.445 at com.android.server.pm.PackageManagerShellCommand.doRunInstall(PackageManagerShellCommand.java:1282)
10:34:12.467 at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1248)
10:34:12.486 at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:184)
10:34:12.506 at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
10:34:12.527 at android.os.ShellCommand.exec(ShellCommand.java:44)
10:34:12.547 at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22167)
10:34:12.568 at android.os.Binder.shellCommand(Binder.java:932)
10:34:12.590 at android.os.Binder.onTransact(Binder.java:816)
10:34:12.612 at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4645)
10:34:12.637 at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4415)
10:34:12.656 at android.os.Binder.execTransactInternal(Binder.java:1162)
10:34:12.681 at android.os.Binder.execTransact(Binder.java:1126)
10:34:12.702 Performing Streamed Install
10:34:12.722 注:有些手机需要点亮手机屏幕并点击【安装】按钮才能安装成功
10:34:14.629 /Applications/HBuilderX.app/Contents/HBuilderX/plugins/launcher/base/android_base.apk: 1 file pushed. 38.0 MB/s (41244291 bytes in 1.036s)
10:34:14.678 avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:fuse:s0 tclass=file permissive=0
10:34:14.694 System server has no access to read file context u:object_r:fuse:s0 (from path /sdcard/android_base.apk, context u:r:system_server:s0)
10:34:14.721 Error: Unable to open file: /sdcard/android_base.apk
10:34:14.740 Consider using a file under /data/local/tmp/
10:34:14.759 Error: Can't open file: /sdcard/android_base.apk
10:34:14.780 Exception occurred while executing 'install':
10:34:14.804 java.lang.IllegalArgumentException: Error: Can't open file: /sdcard/android_base.apk
10:34:14.824 at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:519)
10:34:14.844 at com.android.server.pm.PackageManagerShellCommand.doRunInstall(PackageManagerShellCommand.java:1282)
10:34:14.867 at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1248)
10:34:14.887 at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:184)
10:34:14.908 at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
10:34:14.935 at android.os.ShellCommand.exec(ShellCommand.java:44)
10:34:14.953 at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22167)
10:34:14.974 at android.os.Binder.shellCommand(Binder.java:932)
10:34:14.995 at android.os.Binder.onTransact(Binder.java:816)
10:34:15.018 at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4645)
10:34:15.038 at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4415)
10:34:15.059 at android.os.Binder.execTransactInternal(Binder.java:1162)
10:34:15.082 at android.os.Binder.execTransact(Binder.java:1126)
10:34:15.104 Performing Streamed Install
10:34:17.032 /Applications/HBuilderX.app/Contents/HBuilderX/plugins/launcher/base/android_base.apk: 1 file pushed. 38.5 MB/s (41244291 bytes in 1.021s)
10:34:17.057 avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:fuse:s0 tclass=file permissive=0
10:34:17.082 System server has no access to read file context u:object_r:fuse:s0 (from path /sdcard/android_base.apk, context u:r:system_server:s0)
10:34:17.108 Error: Unable to open file: /sdcard/android_base.apk
10:34:17.134 Consider using a file under /data/local/tmp/
10:34:17.159 Error: Can't open file: /sdcard/android_base.apk
10:34:17.180 Exception occurred while executing 'install':
10:34:17.199 java.lang.IllegalArgumentException: Error: Can't open file: /sdcard/android_base.apk
10:34:17.223 at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:519)
10:34:17.243 at com.android.server.pm.PackageManagerShellCommand.doRunInstall(PackageManagerShellCommand.java:1282)
10:34:17.266 at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:1248)
10:34:17.288 at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:184)
10:34:17.310 at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
10:34:17.333 at android.os.ShellCommand.exec(ShellCommand.java:44)
10:34:17.355 at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22167)
10:34:17.375 at android.os.Binder.shellCommand(Binder.java:932)
10:34:17.399 at android.os.Binder.onTransact(Binder.java:816)
10:34:17.421 at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4645)
10:34:17.458 at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4415)
10:34:17.476 at android.os.Binder.execTransactInternal(Binder.java:1162)
10:34:17.511 at android.os.Binder.execTransact(Binder.java:1126)
10:34:17.528 Performing Streamed Install
10:34:17.545 安装HBuilder基座App失败,请使用手机助手手动安装/Applications/HBuilderX.app/Contents/HBuilderX/plugins/launcher/base/android_base.apk到手机上,并重新运行真机调试。
10:34:17.587 已停止运行...
- 解决:手机开启允许usb安装应用,同时在界面提醒是否安装时点击安装
- 注意:若界面熄屏会导致安装失败
(3) 问题:小米11(Android11 + MiUi 12) 真机运行时出现如下提示
- 解决:将标准基座改为自定义基座
- 局限:每次修改js代码都需重新制作自定义基座才能实现同步,制作自定义基座的次数限制未每天10次
[HBuilder] 13:56:16.473 <br>1. 你今天已打包很多次了,让云打包服务器休息休息吧,你可以明天再来。<br>2. 若需调试推送等三方SDK,可点击菜单“运行” —>“运行到手机或模拟器”—>“制作自定义基座”,<br>无需频繁提交云端打包。<br>3. 我们为正常进行打包的开发者提供了足够的免费打包次数,请合理安排资源,<br>珍惜打包服务器资源,减少他人排队等待。当然,你可以考虑购买额外的打包次数,请使用当前账号登录<br> https://dev.dcloud.net.cn ,选择“付费打包”->“充值记录”进行购买。<br>
- 拓展:标准基座安装到手机显示的是HBuilderX的图标,自定义基座安装到手机显示的是项目应用图标
(4) 提示:Permission denied
rm: /sdcard/Android/data/uni.UNIC018081/apps/__UNI__C018081/www/*: Permission denied
10:18:42.059 mkdir: '/sdcard/Android/data/uni.UNIC018081/apps/__UNI__C018081/www/': Permission denied
- 备注:无影响