aiden_fry
aiden_fry

Reputation: 304

ADB Shell dumpheap - Unable to open file

I am trying to do some memory analysis using adb dumpheap

I am unable to get it to work, every time is says "unable to open file"

I have tried creating a file and pushing it to the device, I have tried pointing to a device in my own computer. Really frustrated and the documentation doesn't say what it should be.

https://developer.android.com/studio/command-line/shell.html#shellcommands

D:\Users\ME\Desktop>adb shell am dumpheap com.my.process logfile.txt
Error: Unable to open file: logfile.txt

The file does exist already in the location. Can anyone please help? I am trying to analyse apps which I do not have the source code for so can not use DDMS memory monitor.

Thanks

Upvotes: 0

Views: 4073

Answers (1)

Jeff Guy
Jeff Guy

Reputation: 157

You're trying to save to logfile.txt. But the filename that dumpheap wants is a file on the device. Try an absolute path that everyone should be able to write to. For me this worked:

./adb shell am dumpheap 1234 /mnt/sdcard/my_heap

Upvotes: 1

Related Questions