Use config.py to locate aapt

This uses aapt_path in config.py to locate the aapt command. The latest
Android SDK moved aapt out of platform-tools/ causing builds which depend
on this path to fail.

Signed-off-by: Frans Gifford <frans.gifford@cs.ox.ac.uk>
This commit is contained in:
Frans Gifford 2013-07-18 18:23:17 +01:00 committed by Daniel Martí
parent f51e4f805e
commit e0e6e711c3
2 changed files with 17 additions and 4 deletions

View file

@ -1564,9 +1564,16 @@ def isApkDebuggable(apkfile, sdk_path):
"""Returns True if the given apk file is debuggable
:param apkfile: full path to the apk to check
:param sdk_path: path to android sdk"""
:param sdk_path: path to android sdk (deprecated)"""
p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
if ('aapt_path' not in globals()):
# (re-)read configuration
execfile('config.py', globals())
if not os.path.exists(aapt_path):
print "Missing aapt - check aapt_path in your config"
sys.exit(1)
p = subprocess.Popen([aapt_path,
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
stdout=subprocess.PIPE)
output = p.communicate()[0]