> For the complete documentation index, see [llms.txt](https://pwnsec-notes.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pwnsec-notes.gitbook.io/ctf-notes/mobile-pentesting/adb.md).

# ADB

{% embed url="<https://adbinstaller.com/>" %}

```
adb devices						#to get the devices that are running
adb shell						#get a shell through the device 
adb -s <device name> shell				#get a shell into a spicified device
adb forward tcp:port(local) tcp:port(the device)	#port forwarding
adb install <apk file>					#installing apk into the device
adb shell <any command>					#executing commands without getteing a shell
adb shell pm list packages 				#List installed packages	
adb shell pm path <package name> 			#Get the path to the apk file of tha package
adb shell ps						#get the PID of the process
adb shell pidof com.your.application			#print the PID of the application
adb logcat 						#getting the logs of the device
adb shell dumpsys					#dumping the data of system
adb.exe shell am start -n <package with the activity>	#starting the activity
adb shell am start -n com.yourpackage/com.yourpackage.YourActivity --es extraKey extraValue    #passing string as extra to the actvity 
```

For more command check the ADB manual&#x20;
