小米11在HBuilderX中真机联调问题

拓展:故障排查指南

(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) 真机运行时出现如下提示


HBuilderX真机运行.png
  • 解决:将标准基座改为自定义基座
  • 局限:每次修改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
  • 备注:无影响
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,233评论 6 495
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,357评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 159,831评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,313评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,417评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,470评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,482评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,265评论 0 269
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,708评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,997评论 2 328
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,176评论 1 342
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,827评论 4 337
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,503评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,150评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,391评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,034评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,063评论 2 352

推荐阅读更多精彩内容