Last active
June 29, 2023 10:13
-
-
Save bojanpotocnik/880ff24f7738562d3434bc44f9a56e27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PACKAGE_NAME=com.my.package | |
# Block until the PACKAGE_NAME starts and print its PID | |
adb_wait_pid() { adb shell "until pidof $PACKAGE_NAME; do :; done"; } | |
# Wait for the app to start and show all its output | |
adb logcat -v color -v printable --pid $(adb_wait_pid) | |
# Wait for the app to start and log to file | |
adb logcat -v printable --pid $(adb_wait_pid) > "logcat_$PACKAGE_NAME_$(date +'%Y%m%d%H%M%S').log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment