Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run adb on a mac terminal?

adb shell run-as /data/data/com.mypackagename  

returns

adb command not found

though I see adb in the directory (/Users/me/Library/Android/sdk/platform-tools)

like image 983
MarcusH Avatar asked Jan 15 '15 18:01

MarcusH


People also ask

How do I run adb devices in terminal?

From Xamarin Studio, go to Tools, then select "Open Android SDK Command Prompt". This will open a terminal window and automatically navigate you to the Android SDK location. From there you can use the ADB command. Show activity on this post.

How do I open adb shell on Mac?

There is a program called Terminal that is installed in OSX that you can use to run the adb shell command. You must open up a Terminal and navigate to the directory that is shown in your screenshot, and then you can run the command ./adb shell and it should work.


2 Answers

You just need to add this path to your bash profile and source it:

echo 'export PATH=$PATH:~/Library/Android/sdk/platform-tools/' >> ~/.bash_profile  source ~/.bash_profile  adb devices 
like image 194
Xin Meng Avatar answered Sep 21 '22 17:09

Xin Meng


If you are in that directory, you can run it with a leading dot-slash, i.e. ./adb shell run-as /data/data/com.mypackagename.

In general, you might want to add that directory to your PATH environment variable.

like image 39
L3viathan Avatar answered Sep 21 '22 17:09

L3viathan