a shell function to measure the graphics performance of two APK files with maestro and gfxinfo
This is a shell function called measure
that compares the graphics performance of two Android apps (APKs) by running a flow of user interactions on each app and collecting data on the app's graphics performance using the dumpsys gfxinfo
command. The function prompts the user to input the names of the two APKs, the flow to run on each app, an optional setup flow, and an optional number of iterations to run the flow (default is 3). The function then installs and runs the flow on each APK, collects the graphics performance data, averages the data, and saves it to a file.
- Android device connected to the computer via ADB
- adb and maestro command line tools must be installed and available in the PATH
- gfx-avg command line tool must be installed and available in the PATH
measure <apk1> <apk2> <measureFlow> [setupFlow] [iteration]
apk1
: The file path of the first APK to testapk2
: The file path of the second APK to testmeasureFlow
: The file path of the flow file to run on each appsetupFlow
(optional): The file path of the setup flow file to run on each app before running the measure flowiteration
(optional): The number of times to run the measure flow on each app (default is 3)
- The function starts by initializing and printing some information about the input arguments.
- The script then prompts the user to uninstall the package of the application if it is already installed.
- Then the script installs
apk1
and runs the setup flow if provided, otherwise it waits for the user to press enter. - Then it runs the measure flow on
apk1
for the number of iterations specified, collecting the graphics performance data using thedumpsys gfxinfo
command and saving the data to a file. - Then it uninstalls
apk1
, installsapk2
and runs the setup flow if provided, otherwise it waits for the user to press enter. - Then it runs the measure flow on
apk2
for the number ofiterations
specified, collecting the graphics performance data using thedumpsys gfxinfo
command and saving the data to a file. - The script then averages the data collected from both
apk1
andapk2
using thegfx-avg
command. - The script then prints
"Done!"
.
- The function does not require any installation, it can be used by just copying the function to the shell script or by sourcing the script containing the function.
👤 theapache64
- Twitter: @theapache64
- Email: [email protected]
Feel free to ping me 😉
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Open an issue first to discuss what you would like to change.
- Fork the Project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a pull request
Please make sure to update tests as appropriate.
Give a ⭐️ if this project helped you!
Copyright © 2023 - theapache64
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This README was generated by readgen ❤