Skip to content

0187773933/ADBWrapper

Repository files navigation

ADB Wrapper

TODO

Get Activites from APK

  1. brew install --cask android-sdk
  2. export ANDROID_HOME=/usr/local/share/android-sdk
  3. yes | sdkmanager --licenses
  4. sdkmanager --list
  5. sdkmanager "build-tools;34.0.0"
  6. /usr/local/share/android-sdk/build-tools/34.0.0/aapt --version
  7. sudo ln -s "/usr/local/share/android-sdk/build-tools/34.0.0/aapt" /usr/local/bin/aapt
  8. aapt dump xmltree <apk-file> AndroidManifest.xml > apk-file.txt
  9. aapt list -a /path/to/the/apk > apk-file.all.txt

ADB Info Links

ADB Code Examples

ADB Misc Commands

  • adb shell

  • adb shell getprop ro.serialno

  • pm list packages | sed -e "s/package://" | while read x; do cmd package resolve-activity --brief $x | tail -n 1 | grep -v "No activity found"; done

  • adb shell am start tv.twitch.android.viewer/tv.twitch.android.apps.TwitchActivity

  • adb shell input touchscreen tap 100 100

  • adb shell am start -W -a android.intent.action.VIEW -d "example://gizmos" com.example.android

  • adb shell pm list packages -f

  • adb shell dumpsys window windows

  • adb shell dumpsys window windows | find "mcurrentfocus"

  • adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'

  • adb shell dumpsys display

  • intent://#Intent;package=qualified.package.name;end

  • adb shell am to-uri tv.twitch.android.viewer/tv.twitch.android.apps.TwitchActivity

  • adb shell am start -W -a android.intent.action.VIEW -d "example://gizmos" com.example.android

  • adb shell am start -W -a android.intent.action.VIEW -d "intent://#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;component=tv.twitch.android.viewer/tv.twitch.android.apps.TwitchActivity;end" com.example.android

  • content query --uri content://settings/global

  • adb shell monkey -p <insert-package-name> -c android.intent.category.LAUNCHER 1

  • adb shell input touchscreen text "Wow,\ it\ so\ cool\ feature"

  • adb shell am start -n tv.twitch.android.viewer/tv.twitch.android.apps.TwitchActivity --es "toast" "hello, world"

  • adb shell pm dump tv.twitch.android.viewer

  • adb shell "cmd package resolve-activity tv.twitch.android.viewer"

  • adb shell logcat -d | grep 'START u0' | tail -n 1 | sed 's/.*cmp=\(.*\)} .*/\1/g'

  • adb shell dumpsys package | grep -Eo "^[[:space:]]+[0-9a-f]+[[:space:]]+tv.twitch.android.viewer/[^[:space:]]+" | grep -oE "[^[:space:]]+$"

  • adb shell service call audio 3 i32 3 i32 0 i32

  • adb exec-out screencap -p > test.png

  • adb install instagram.apk

Get Info

  • adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
  • adb shell dumpsys media_session | grep "state=PlaybackState"
  • adb shell dumpsys media_session
  • adb shell content query --uri content://call_log/calls
  • adb shell getevent -il

Twitch

adb shell am start -a android.intent.action.VIEW -d "twitch://stream/chess24" && \
adb shell input keyevent 4

Disney

  • adb shell am start -a android.intent.action.VIEW -d "https://www.disneyplus.com/video/74351ae5-f6cd-4464-aeb6-8f4b10ca2649"

Spotify

  • Startup = adb shell am start -a android.intent.action.VIEW -d "spotify:playlist:46CkdOm6pd6tsREVoIgZWw:play"
  • Startup-Random =
adb shell am start -a android.intent.action.VIEW -d "spotify:playlist:46CkdOm6pd6tsREVoIgZWw:play" && \
adb shell input keyevent 21 21 23 && sleep 1 && \
adb shell input keyevent 22 22 22 && sleep 0.4 && adb shell input keyevent 23 && sleep 2 \
adb shell input tap 500 500

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published