Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autosize do not work on SDK 19 #2

Open
Chrisplus opened this issue Aug 5, 2015 · 1 comment
Open

autosize do not work on SDK 19 #2

Chrisplus opened this issue Aug 5, 2015 · 1 comment

Comments

@Chrisplus
Copy link

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.

@sorccu
Copy link
Member

sorccu commented Aug 5, 2015

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!

ledinhphuong pushed a commit to ledinhphuong/minicap that referenced this issue Sep 8, 2016
Remove banner in image data, fix wait too long to get screenshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants