Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Side by Side Diff: build/android/pylib/utils/apk_helper.py

Issue 12921004: [Android] Enable running uiautomator tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Module containing utilities for apk packages."""
6
7 import re
8
9 from pylib import cmd_helper
10
11
12 def GetPackageName(apk_path):
13 """Returns the package name of the apk."""
14 aapt_output = cmd_helper.GetCmdOutput(
15 ['aapt', 'dump', 'badging', apk_path]).split('\n')
16 package_name_re = re.compile(r'package: .*name=\'(\S*)\'')
17 for line in aapt_output:
18 m = package_name_re.match(line)
19 if m:
20 return m.group(1)
21 raise Exception('Failed to determine package name of %s' % apk_path)
OLDNEW
« no previous file with comments | « build/android/pylib/uiautomator/test_package.py ('k') | build/android/pylib/utils/jar_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698