zoukankan      html  css  js  c++  java
  • 真机使用adb命令打开包名报错 java.lang.SecurityException: Permission Denial: starting Intent 【已解决】

    使用adb命令安装包名的时候报错了

    我是直接用 adb shell dumpsys window | findstr mCurrentFocus 获取的

    获取到了这一段: uni.UNIDD11F28/io.dcloud.PandoraEntryActivity

    但是我用这一段准备打开app的时候报错了

    C:Usersadmin>adb shell am start uni.UNIDD11F28/io.dcloud.PandoraEntryActivity
    Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=uni.UNIDD11F28/io.dcloud.PandoraEntryActivity }
    Security exception: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=uni.UNIDD11F28/io.dcloud.PandoraEntryActivity } from null (pid=26830, uid=2000) not exported from uid 10233
    
    java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=uni.UNIDD11F28/io.dcloud.PandoraEntryActivity } from null (pid=26830, uid=2000) not exported from uid 10233
            at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1089)
            at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:789)
            at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:588)
            at com.android.server.wm.ActivityStarter.startActivityMayWait(ActivityStarter.java:1390)
            at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:519)
            at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1091)
            at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1065)
            at com.android.server.am.ActivityManagerService.startActivityAsUser(ActivityManagerService.java:3569)
            at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:518)
            at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:172)
            at android.os.ShellCommand.exec(ShellCommand.java:104)
            at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10093)
            at android.os.Binder.shellCommand(Binder.java:881)
            at android.os.Binder.onTransact(Binder.java:765)
            at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:4727)
            at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2799)
            at android.os.Binder.execTransactInternal(Binder.java:1021)
            at android.os.Binder.execTransact(Binder.java:994)

    然后再网上查阅资料发现,我们获取到的活动入口可能不是真正的入口

    解决问题方案如下:

    1.我们通过拿到包名去获取包的详细信息

    adb shell
    dumpsys package uni.UNIDD11F28

     我标记出来的为真正的包名

    2.重新打开app

    adb shell am start uni.UNIDD11F28/io.dcloud.PandoraEntry

    引用文章:https://blog.csdn.net/yangsummer2426/article/details/80929869

    adb shell dumpsys window | findstr mCurrentFocus 

  • 相关阅读:
    eslint 入门学习
    sqlite数据库 select 查询带换行符数据
    (ios)ARC常用设置,部分文件编译设置ARC
    (ios实战)ios调试总结(转载)
    IOS沙盒Files目录说明和常用操作
    (Ios 实战) 自定义UITableView
    iphone,pad等真机不被xcode识别,解决方法
    Xcode模拟器和真机生成的日志查看(转载)
    项目管理(转载)
    互联网教育,未来当有这10个特质(转载)
  • 原文地址:https://www.cnblogs.com/yushengaqingzhijiao/p/15238331.html
Copyright © 2011-2022 走看看