8000 autosize do not work on SDK 19 · Issue #2 · openstf/minicap · GitHub
[go: up one dir, main page]

Skip to content

autosize do not work on SDK 19 #2

Open

Description

@Chrisplus

Thanks for the awesome project.

I test run.sh on a google glass running SDK 19. But 'autosize' do not work. I find the following codes always return empty strings.

args=
if [ "$1" = "autosize" ]; then
  set +o pipefail
  size=$(adb shell dumpsys window | grep -Eo 'init=\d+x\d+' | head -1 | cut -d= -f 2)
  if [ "$size" = "" ]; then
    w=$(adb shell dumpsys window | grep -Eo 'DisplayWidth=\d+' | head -1 | cut -d= -f 2)
    h=$(adb shell dumpsys window | grep -Eo 'DisplayHeight=\d+' | head -1 | cut -d= -f 2)
    size="${w}x${h}"
  fi
  args="-P $size@$size/0"
  set -o pipefail
  shift
fi

I try to fix it by changing the code to

args=
if [ "$1" = "autosize" ]; then
  set +o pipefail
  size=$(adb shell dumpsys window | grep -Eo 'init=\d+x\d+' | head -1 | cut -d= -f 2)
  if [ "$size" = "" ]; then
    size=$(adb shell wm size| cut -d: -f2 |tr -d " \n\t\r")
  fi
  args="-P $size@$size/0"
  set -o pipefail
  shift
fi

I'm not sure if wm size can return the exact same thing with dumsys window, if not, please correct me.

Thank you.

Activity

  1. sorccu commented on Aug 5, 2015

    @sorccu
    Member

    We haven't had the opportunity to try Google Glass yet, but the current run.sh script does work on many SDK 19 devices we have. Thanks for letting us know though!

  2. added a commit that references this issue on Sep 8, 2016
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0