path: android-platform-art_14.0.0+r15-6/imgdiag/imgdiag.cc usage += "Usage: imgdiag [options] ...\n" " Example: imgdiag --image-diff-pid=$(pidof dex2oat)\n" " Example: adb shell imgdiag --image-diff-pid=$(pid zygote)\n" "\n"; path: android-platform-art_14.0.0+r15-6/tools/jvmti-agents/simple-force-redefine/README.md Since the agent has no static state it can be attached multiple times to the same process. > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist2` > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` path: android-platform-art_14.0.0+r15-6/tools/jvmti-agents/simple-force-redefine/README.md > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist2` > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` path: android-platform-art_14.0.0+r15-6/tools/jvmti-agents/simple-force-redefine/README.md > `adb push /tmp/classlist /data/local/tmp/` > > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` Since the agent has no static state it can be attached multiple times to the same process. path: android-platform-art_14.0.0+r15-6/tools/jvmti-agents/simple-force-redefine/README.md > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist2` > `adb shell am attach-agent $(adb shell pidof some.deubggable.app) /data/local/tmp/libforceredefine.so=/data/local/tmp/classlist` One can also use fifos to send classes interactively to the process. (TODO: Have the agent path: android-platform-art_14.0.0+r15-6/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java public Set getSystemServerLoadedArtifacts() throws Exception { String systemServerPid = assertCommandSucceeds("pidof system_server"); assertTrue(!systemServerPid.isEmpty()); assertTrue("There should be exactly one `system_server` process", path: android-platform-art_14.0.0+r15-6/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java // implementation is wrong and it outputs multiple pids regardless of the "-s" flag, so we // split the output and take the first pid ourselves. String zygotePid = assertCommandSucceeds("pidof " + zygoteName).split("\\s+")[0]; assertTrue(!zygotePid.isEmpty()); path: android-platform-art_14.0.0+r15-6/test/odsign/test-src/com/android/tests/odsign/OdsignTestUtils.java // There may be multiple Zygote processes when Zygote just forks and has not executed any // app binary. We can take any of the pids. // We can't use the "-s" flag when calling `pidof` because the Toybox's `pidof` // implementation is wrong and it outputs multiple pids regardless of the "-s" flag, so we // split the output and take the first pid ourselves. path: android-platform-art_14.0.0+r15-6/test/testrunner/testrunner.py proc_name = "dalvikvm" + test_name[-2:] pidof = subprocess.run(["adb", "shell", "pidof", proc_name], stdout=subprocess.PIPE) for pid in pidof.stdout.decode("ascii").split(): if i >= 4: print_text("Backtrace of %s at %s\n" % (pid, time.monotonic())) path: android-platform-art_14.0.0+r15-6/test/testrunner/testrunner.py for i in range(8): proc_name = "dalvikvm" + test_name[-2:] pidof = subprocess.run(["adb", "shell", "pidof", proc_name], stdout=subprocess.PIPE) for pid in pidof.stdout.decode("ascii").split(): if i >= 4: path: android-platform-art_14.0.0+r15-6/tools/jvmti-agents/dump-jvmti-state/README.md > `adb shell am start-activity --attach-agent /data/local/tmp/libdumpjvmti.so some.debuggable.apps/.the.app.MainActivity` > > `adb shell kill -3 $(adb shell pidof some.debuggable.apps)`