Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why can't pidcat find this directory?

Tags:

android

logcat

Marcs-MacBook-Pro:java marcus$ pidcat com.myapp.android.debug

Traceback (most recent call last):
  File "/usr/local/bin/pidcat", line 150, in <module>
    adb = subprocess.Popen(adb_command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child
    raise child_exception
OSError: [Errno 20] Not a directory

I specified com.myapp.android.debug since I saw it in Android Studio's logcat viewer, though I don't physically have the debug folder. I ran the pidcat script in the parent directory of "com"; java/com/myapp/android

like image 254
MarcusH Avatar asked Jan 25 '15 04:01

MarcusH


2 Answers

Make sure that adb is in your path, and that you use an absolute path, no tilda (~)

So you should be able to run echo $PATH and get something like this.

Marcs-MacBook-Pro:java marcus$ echo $PATH
/Users/marcush/Library/Android/sdk/platform-tools:<restofpath>
like image 55
TomW Avatar answered Oct 10 '22 03:10

TomW


Related to the above error , you might not have the pidcat.py script on your system. Please ensure the following (as steps mentioned on pidcat page)

  1. Python is installed on your system
  2. Command Line 'adb' is installed. If not try adding sdk path in your PATH variable
export PATH=“/Users/userName/Library/Android/sdk/platform-tools”:$PATH 

Refer Set up adb on Mac OS X)

  1. Include these lines in your .bashrc or .zshrc
echo "export PATH=\$PATH:/Users/${USER}/Library/Android/sdk/platform-tools/" >> ~/.bash_profile && source ~/.bash_profile

  1. Verify adb is up and running, by using
adb devices
  1. Download the pidcat.py file and place it in your path.

  2. final path will look something like this

export PATH=/Users/mayurik/Library/Android/sdk/platform-tools/adb:/Users/mayurik/Library/Android/sdk/tools:/Users/mayurik/pidcat/pidcat.py:/anaconda2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

  1. Finally try running pidcat on your terminal.
like image 22
Mayuri Khinvasara Avatar answered Oct 10 '22 05:10

Mayuri Khinvasara