Skip to content

current_app()结果不对 #52

Description

@xiaotuoyang

hdc shell aa dump -l命令输出如下:

  current mission lists:{
    Mission ID #275  mission name #[#com.huawei.hmos.photos:phone_photos:com.huawei.hmos.photos.MainAbility]  lockedState #0  mission affinity #[]
      AbilityRecord ID #6842
        app name [com.huawei.hmos.photos]
        main name [com.huawei.hmos.photos.MainAbility]
        bundle name [com.huawei.hmos.photos]
        ability type [PAGE]
        state #BACKGROUND  start time [864068282]
        app state #BACKGROUND
        ready #1  window attached #0  launcher #0
        callee connections: 
        isKeepAlive: false
    Mission ID #298  mission name #[#com.xiaotuo.yang:entry:EntryAbility]  lockedState #0  mission affinity #[]
      AbilityRecord ID #7051
        app name [com.xiaotuo.yang]
        main name [EntryAbility]
        bundle name [com.xiaotuo.yang]
        ability type [PAGE]
        state #FOREGROUND  start time [892956626]
        app state #FOREGROUND
        ready #1  window attached #0  launcher #0
        callee connections: 
        isKeepAlive: false
 }

current_app() 中 正则 re.findall(r'Mission ID #[\s\S]*?isKeepAlive: false\s*}', output) 的结果就是整个字符串,需要去掉表达式末尾的'}'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions