-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_moderate_memory.bat
More file actions
34 lines (27 loc) · 903 Bytes
/
test_moderate_memory.bat
File metadata and controls
34 lines (27 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
REM Query the host for connected Android devices. If one is found, send moderate MODERATE level signal to App
setlocal enabledelayedexpansion
set ANDROID_SDK=C:\Software\AndroidSDK
set BUILD_TOOLS=24.0.0
call "%~dp0\choose_device.bat"
if not exist "%~dp0\chosendevice.temp" (
echo "No device was chosen. Aborting."
exit /b
)
set /p chosendevice=< "%~dp0\chosendevice.temp"
del "%~dp0\chosendevice.temp"
set packagename=none
%ANDROID_SDK%\build-tools\%BUILD_TOOLS%\aapt dump badging test.apk > "%~dp0\tmpFile"
for /f "usebackq tokens=1-2 delims=|" %%a in (%~dp0\tmpFile) do (
for /f "delims= " %%b in ("%%a") do (
for /f "tokens=2 delims='" %%c in ("%%b") do (
set packagename=%%~c
goto packagefound
)
)
)
:packagefound
del %~dp0\tmpFile
echo Sending MODERATE memory signal to "%packagename%" on !chosendevice!
adb shell am send-trim-memory %packagename% MODERATE
timeout 2