How to launch the app and auto open logcat? #7

Open
opened 2025-08-09 17:12:54 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @riderx on 10/17/2024

99% of the time I don't use the debugger, I just open the app and read the logcat logs.
So i made config like that:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "android",
            "request": "launch",
            "name": "Launch Android App",
            "preLaunchTask": "Build Android Debug",
			"postDebugTask": "${command:android-dev-ext.view_logcat}",
            "appSrcRoot": "${workspaceRoot}/android/app/src/main",
            "apkFile": "${workspaceRoot}/android/app/build/outputs/apk/debug/app-debug.apk",
            "adbSocket": "localhost:5037",
            "autoStartADB": true,
            "staleBuild": "warn",
            "manifestFile": "${workspaceRoot}/android/app/src/main/AndroidManifest.xml",
            "pmInstallArgs": ["-r"],
			"targetDevice": "${command:PickAndroidDevice}",
            "amStartArgs": [
                // "-D",
                "--activity-brought-to-front",
                "-a android.intent.action.MAIN",
                "-c android.intent.category.LAUNCHER",
                "-n com.primeopinion.appname.staging/com.primeopinion.appname.staging.MainActivity"
            ],
            "postLaunchPause": 1000,
            "trace": false
        }
    ]
}

But it seems the logcat is started before the app is start how to connect it properly?

*Originally created by @riderx on 10/17/2024* 99% of the time I don't use the debugger, I just open the app and read the logcat logs. So i made config like that: ```json { "version": "0.2.0", "configurations": [ { "type": "android", "request": "launch", "name": "Launch Android App", "preLaunchTask": "Build Android Debug", "postDebugTask": "${command:android-dev-ext.view_logcat}", "appSrcRoot": "${workspaceRoot}/android/app/src/main", "apkFile": "${workspaceRoot}/android/app/build/outputs/apk/debug/app-debug.apk", "adbSocket": "localhost:5037", "autoStartADB": true, "staleBuild": "warn", "manifestFile": "${workspaceRoot}/android/app/src/main/AndroidManifest.xml", "pmInstallArgs": ["-r"], "targetDevice": "${command:PickAndroidDevice}", "amStartArgs": [ // "-D", "--activity-brought-to-front", "-a android.intent.action.MAIN", "-c android.intent.category.LAUNCHER", "-n com.primeopinion.appname.staging/com.primeopinion.appname.staging.MainActivity" ], "postLaunchPause": 1000, "trace": false } ] } ``` But it seems the logcat is started before the app is start how to connect it properly?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/android-dev-ext#7
No description provided.