Android Native Heap Inspection DDMS - android

I'm having trouble getting the native heap information from my HTC
Magic running Android 2.2.1.
I've configured the standalone DDMS setting "native=true" and used the
commands:
adb shell setprop libc.debug.malloc 1
adb shell stop
adb shell start
However, when I try to check if the property is set correctly by issueing the command:
adb shell ls
I get the following log message:
"/system/bin/sh: Missing module /system/lib/libc_malloc_debug_leak.so required for malloc debug level 1"
Can someone help me with getting the native heap allocations?
Thanks,
Ove Danner

I'm using this on a Xoom : http://code.google.com/p/honeycomb-sdk-united-base/source/browse/trunk/system/lib/?r=8
Download the raw file using "save as"and then
adb remount
adb push libc_malloc_debug_leak.so /system/lib/libc_malloc_debug_leak.so
You already have root so the adb remount and pushing to /system/lib should work for you.
You can "probably" also build that library by building Android from source. But this was quicker for me.

Related

How to make system partition in AVD in emulator writable

This is fairly a very old question but I am surprised that none of the solutions are working for me. I need to run an android app as system app in an AVD (in emulator) created for Android version 7.0. For this, I want to push apk file to system partition but I keep getting error saying it is read only file system. I found many similar questions on stackoverflow but nothing is working for me. I restarted adb in root, executed it with remount as suggested in answers to similar questions, but system partition file system permissions do not change. Here is a sample session:
mvsagar#mvslt:~/sw/android_sdk/platform-tools$ ./adb root
restarting adbd as root
mvsagar#mvslt:~/sw/android_sdk/platform-tools$ ./adb remount
remount succeeded
mvsagar#mvslt:~/sw/android_sdk/platform-tools$ ./adb push /home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk /system/app/LCNUE.apk
adb: error: failed to copy '/home/mvsagar/projects/AndroidStudioProjects/LcnApps/app/LCNUE.apk' to '/system/app/LCNUE.apk': couldn't create file: Read-only file system
I have tried manually remounting with read/write(rw) options using adb shell, but the remounting fails.
Is there any way to have read/write permission on system partition?
My dev env is Android Studio on Ubuntu.
In my case, I use a avd( Based on: Android 8.0 (Oreo) Tag/ABI: google_apis/x86_64 ).
$ emulator -avd Nexus_5X_API_26_APIs -writable-system
$ adb root
$ adb remount
Then, /system is writeable.
$ adb push somefile /system/bin/ is work.
When working with Q, this is the only solution that worked for me: https://stackoverflow.com/a/64397712/1898527
Adding here the steps for completion (kudos to the original author):
> emulator -avd Pixel_3a_XL_API_29 -writable-system
> adb shell avbctl disable-verification
> adb disable-verity
Now reboot your emulator so that the changes take effect.
> adb root
> adb remount
> adb shell "su 0 mount -o rw,remount /system"
Note: you will need an emulator without Google Play, otherwise this won't work. You can get it by following the steps described here: https://stackoverflow.com/a/45668555/1898527
use genymotion emulator, which is faster, light weight and pre rooted. (which means you can access system directory)
For the benefit of others, answer to the question was answered a long ago by #Ishamael in another stackoverflow question Read only file system on Android

Unable to run app - "The target device does not support the 'run-as' command"

Running Android Studio on a Macbook for the first time and I'm getting this error. The program does not start on my device, I just get a crash message.
On Android Studio, I get "The target device does not support the 'run-as' command" and when I plug this into google I get no results. I get a "Learn More" section though which points to this link under the heading "About Instant Run": https://developer.android.com/studio/run/index.html?utm_medium=android-studio#instant-run.
Any suggestions would be highly appreciated.
I recently upgraded to AS 2.2 and this message suddenly appeared today.
Restarting Studio caused this message to disappear.
But the build in general seemed slow - so I used the adb commands to stop and start the server and now it seems Instant run is working better
adb kill-server
adb start-server
my phone is Moto G x1032 w lollipop
I had this same problem after rooting my device and the other answer didn't solve it.
When I ran adb run-as command in the terminal I kept getting
Could not set Capabilities: operation not permitted.
It's a permissions issue. You have to change permissions on run-as file in /system/bin folder. This solved it for me (needs root access):
1. remount /system rw
2. chmod 4750 /system/bin/run-as
3. remount /system ro
If running custom recovery:
1. reboot to recovery
2. find the mount system and check it (make sure 'mount system as read-only' is unchecked)
3. open a terminal and type: adb shell
4. type: chmod 4750 /system/bin/run-as
5. uncheck the System mount and reboot!
See here issue 58373: https://code.google.com/p/android/issues/detail?id=58373

[Android ADB]"adb shell logcat" write to internal memory failed to execute intermittently

I tried to capture logcat & store into the device's internal memory. But notice that, this doesn't work intermittently. Doesn't work in the scene that, 0 bytes logcat was generated.
Command that I used, and failed intermittently.
adb shell "logcat -b main -v threadtime > /data/logcat.log &"
BUT if I stored it directly to my PC, it works perfectly.
adb shell logcat -b main -v threadtime > logcat.log &
ADB version : Android Debug Bridge version 1.0.32
Thanks.
If you are running on a commercial, non-rooted device, /data/ is not writeable. The shell runs as the shell user. That part of the flash is only writeable by root or system users. If you really want to write to the device for some reason, write to /data/local/tmp instead.

ADB will not run

I just installed the android SDK with eclipse, straight from google's webpage, but for some reason it won't run, even when I am in the correct directory. When I use 'ls' (crunchbang linux) it show's that the file is there, but when I try to run it, it returns no such file or directory. Any ideas?
type script in your command if you adb configured.
adb stop-server
adb start-server
adb devices

adb pull freezes when it encounters kmsg

I'm trying to debug why my android mobile will not boot. When I run:
adb pull / e:\temp
It freezes at
pull: /proc/kmsg -> e:\temp/proc/kmsg
Is there some way to stop it freezing here or to get 'pull' to by-pass this file.
(I'm running this command while the phone is sitting in the recovery menu as I cant get adb to run in any other state).
Samsung Galaxy GT-i5500, android 2.2, windows 7.
You can instead dump the log using
adb logcat -d > log.txt
This will provide you with the log which you can use to debug the issue.
Run-time messages can be obtained through
adb shell dmesg
For kmsg, the following command can be tried.
adb shell cat /proc/kmesg

Categories

Resources