# GetFPS **Repository Path**: bearxup/GetFPS ## Basic Information - **Project Name**: GetFPS - **Description**: No description available - **Primary Language**: Shell - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-26 - **Last Updated**: 2023-10-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 从大佬的 github fork 来的:[NasdaqGodzilla/GetFPS](https://github.com/NasdaqGodzilla/GetFPS)。 主要改动有如下3点: 1. 根据使用过程中发现的问题解决了一个 bug,"View hierarchy:" 会被 "sed /^$/{N;d}" 误删; 2. 原作代码实在是满屏的警告,所以代码格式,写法改动较多; 3. 将原本的 utils.sh 内容合并到 get_fps.sh 中,这样可以直接执行 `adb shell source /data/local/tmp/get_fps.sh` 获取 fps,而不需要重复执行 `adb shell; cd /data/local/tmp`。 2和3属于个人偏好,怕大佬不喜欢所以没有推送到大佬的仓库。以下是原文: # GetFPS Get FPS/Frame rate by Android adb shell command. # Install Push scripts into Android device. ``` adb push get_fps.sh /data/local/tmp ``` # Usage - Print FPS of current top resumed app ``` $ source get_fps.sh FPS: 59 or: adb shell source /data/local/tmp/get_fps.sh ``` - Print average render elapsed time of current top resumed app ``` $ source get_fps.sh -t Average elapsed 20.54 ms ``` - Select target package instead of top resumed app ``` $ source get_fps.sh -p com.android.settings ``` - Loop ``` watch -tn1 "eval source get_fps.sh" ``` - Loop by while ``` while true do source get_fps.sh sleep 1 done ``` # License MIT License Copyright (c) 2022 Niko Zhong Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.