Iam trying to trigger low memory events using android studio's terminal:
To trigger your onTrimMemory callbacks:
adb shell am send-trim-memory
e.g. adb shell am send-trim-memory com.example.app MODERATE
but i get this message Unknown command 'send-trim-memory' . Iam using emulator on the latest android.
Thank you
Related
I am using Android Studio 2020.3.1.
I want to launch a adb shell from within Android Studio.
I have the Terminal tab at the very bottom of the IDE.
But I can only open "Local" terminals.
Any ideas where I can launch a "Remote" adb shell?
Within you local terminal, you can easily start an adb shell with the command adb shell
Locate adb if it's not already in your executable paths environment variable. The location largely dependent on the OS you use and where you install the Android SDK. In general it's in the ${ANDROID_SDK}/platform-tools/ directory.
Execute adb devices. This will list the connected adb capable devices. If you are not running any emulators and you only connect your phone then your phone would show up (if not then you may need to treat some permission steps depending on your operating system). Let's say the ID of your device is XYZ.
Execute adb -s XYZ shell and you'll be in a shell on your device.
Objective: I want to automate call related scenario using android uiautomator in android 6.0.1 devices. But not able to get UI hierarchy in incall screen (Mute, Spearker On, Keypad, Addcall etc.)
Note: I am not using any appium server
Error: "Error obtaining UI hierarchy" Reason: Error while obtaining UI
hierarchy XML file: com.android.ddmlib.SyncException: Remote object
doesn't exist!
Observations:
adb devices is listing the device and we can access /data/local/tmp/ directory
restarted device, restarted pc, relaunch of uiautomatorviewer
adb shell input tap x y is working (but don't want to use co-ordinates in scripts files)
please assist in finding a solution in order to automate phone app incall scenarios like "mute" , "unmute" , "dtmf pressing keypad numbers", "speaker on" speaker off".
Is there any way to perform such actions via adb ?
You can simply call adb command to invoke the caller service.
To dial (not call) a number from ADB, run the following ADB shell command:
$ adb shell service call phone 1 s16 "9302939203"
Result: Parcel(00000000 '....')
To make a call from ADB, we just need to change the way we call the service command:
$ adb shell service call phone 2 s16 "1" s16 "9302939203"
Result: Parcel(00000000 '....')
An alternative command is also there to make a phone call from ADB:
$ adb shell am start -a android.intent.action.CALL -d tel:9302939203
Starting: Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxxxx }
I'm trying to get memory info which is allocated by my specific application using "adb shell procrank".
But when i'm trying to execute the procrank command from cmd promt its giving me error like "/system/bin/sh: procrank: not found".
I cant guess what it means!
Thanks in advance.
Procrank is not installed on all devices, you will have to use the following command: "adb shell dumpsys meminfo", it won't give you the memory usage per app, but its an alternative.
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
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.