Advertisement
metalx1000

Android App Activity Launcher

Nov 19th, 2023
1,251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.60 KB | None | 0 0
  1. #!/bin/bash
  2. ######################################################################
  3. #Copyright (C) 2023  Kris Occhipinti
  4. #https://filmsbykris.com
  5.  
  6. #This program is free software: you can redistribute it and/or modify
  7. #it under the terms of the GNU General Public License as published by
  8. #the Free Software Foundation version 3 of the License.
  9.  
  10. #This program is distributed in the hope that it will be useful,
  11. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #GNU General Public License for more details.
  14.  
  15. #You should have received a copy of the GNU General Public License
  16. #along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17. ######################################################################
  18.  
  19. function error(){                                                                                                                            
  20.   echo $*                                                                                                                                    
  21.   exit 1                                                                                                                                    
  22. }
  23.  
  24. #check if devices is connected
  25. adb get-state || error "No Devices Connected"
  26.  
  27. #list packages
  28. list="$(adb shell dumpsys package | grep Activity|awk '{$1=$1;print}')"
  29. list="$(echo "$list"|grep -v "^knownActivityEmbeddingCerts="|rev|awk '{print $1}'|rev)"
  30. app="$(echo "$list"|sort -u|fzf --prompt "Select an Activity: ")"
  31. adb shell am start -a android.intent.action.MAIN -n "$app"
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement