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

apk_builder.py returns an error - No such file or directory when calling subprocess.check_output() #24

Closed
illnino opened this issue Apr 17, 2017 · 2 comments

Comments

@illnino
Copy link

illnino commented Apr 17, 2017

Problem

subprocess.check_output(["aapt", "dump", "badging", apk_path]) returns an error - No such file or directory.

ENV

(venv) ➜  apk_builder git:(nino) ✗ python --version
Python 2.7.10

Mac OS: 10.11.6

(venv) ➜  apk_builder git:(nino) ✗ pip list
Package        Version
-------------- -------
alembic        0.9.1
appdirs        1.4.3
blindspin      2.0.1
chardet        3.0.2
click          6.7
colorama       0.3.7
configparser   3.5.0
crayons        0.1.2
dataset        0.8.0
Flask          0.12.1
frida          9.1.27
itsdangerous   0.24
Jinja2         2.9.6
Mako           1.0.6
MarkupSafe     1.0
normality      0.4.0
packaging      16.8
pick           0.6.3
pip            9.0.1
pmm            0.5.0
prompt-toolkit 1.0.14
Pygments       2.2.0
pyparsing      2.2.0
python-editor  1.0.3
PyYAML         3.12
requests       2.13.0
setuptools     34.4.0
six            1.10.0
SQLAlchemy     1.1.9
termcolor      1.1.0
wcwidth        0.1.7
Werkzeug       0.12.1
wheel          0.29.0

Reproduction Steps

(venv) ➜  apk_builder git:(nino) ✗ python apk_builder.py --apk /Users/its/Desktop/myapp.apk

     ___      .______   .______   .___  ___.   ______   .__   __.
    /   \     |   _  \  |   _  \  |   \/   |  /  __  \  |  \ |  |
   /  ^  \    |  |_)  | |  |_)  | |  \  /  | |  |  |  | |   \|  |
  /  /_\  \   |   ___/  |   ___/  |  |\/|  | |  |  |  | |  . `  |
 /  _____  \  |  |      |  |      |  |  |  | |  `--'  | |  |\   |
/__/     \__\ | _|      | _|      |__|  |__|  \______/  |__| \__|
					    github.com/dpnishant


[I] Preparing work directory...
[I] Expanding APK...
Traceback (most recent call last):
  File "apk_builder.py", line 94, in <module>
    apk_dump = subprocess.check_output(["aapt", "dump", "badging", apk_path])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
@dpnishant
Copy link
Owner

dpnishant commented Apr 22, 2017

@illnino You need to

  1. Download android-sdk command-line tools
  2. Install the Android SDK Platform Tools, Android SDK Build Tools by running the command ./android from within extracted ZIP archive
  3. Set the $PATH environment variable to point to the build-tools, platform-tools & tools directory of the Android SDK.
  4. Confirm step 3 by running the command which android, which aapt etc. to make sure they all point to the directory you just set.
  5. You would also need to install apktool, if not already installed. Read the guide here

@illnino
Copy link
Author

illnino commented Apr 24, 2017

Thanks. It worked now.

@illnino illnino closed this as completed Apr 24, 2017
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