These are some very useful tips THAT I’ve accumulated in my daily development. Share it and add it to your collection
- Pull up the application through the shell
Pull up application: adb shell am start - n com. Example. The app/com. Example. App. LauncherActivity force: adb shell am force-stop com.example.appCopy the code
- Hidden system Toast:
appops set android TOAST_WINDOW deny
appops set com.android.systemui TOAST_WINDOW deny
Copy the code
- Toast a Toast
adb shell uiautomator events
Copy the code
- Turn on/off USB ADB:
settings put global adb_enabled 0
settings put global adb_enabled 1
Copy the code
- Adb Port Forwarding
adb reverse tcp:8080 tcp:8080
adb forward tcp:8080 tcp:8080
Copy the code
- Set screen Brightness
settings put system screen_brightness 0; / / 0-255Copy the code
- Lists configurable items
adb shell settings list system
adb shell settings list global
adb shell settings list secure
Copy the code
- Sending broadcasts in command line mode
am broadcast -a com.example.app.ACTION --es k v
Copy the code
- The shell command sets the default input method
$ adb shell ime
usage: ime list [-a] [-s]
ime enable ID
ime disable ID
ime set ID
Copy the code