This folder contain scripts to ease life while developing on Android.
This script set the list of the applications that must be used by other scrips (clear_data_app.sh, ...).
This script define the expected signature of the applications
- signatureListArray : the signatures.
- certificateHashArray : the certificates hashes.
- signatureAPKNameExceptionArray : the list of the APKs that the signature must be ignored.
This script contain generic functions used by other scripts.
Based on different methods, try to get the OS type we are running on.
Used by detect_os when the first method fail, to detect the OS.
Wait for any Android device to be connected.
Avoid displaying stack when using popd and pushd
Check that Java is available.
Check that ADB is available.
Check that zipalign is available.
Check that aapt is available.
Check that certutil is available.
Check that jarsigner is available.
Check that emulator is available.
Check that keytool is available.
Check that telnet is available (For Windows).
Check that python is available (For Windows).
Check that pip is available (For Windows).
Check that frida is available (For Windows).
This is a template for script using serial name.
This is a template for script using serial name AND package name.
This script activate Wi-Fi, then activate ADB over Wi-Fi, extract IP address and connect to device.
Example :
./activate_connect_tcp.sh
./activate_connect_tcp.sh -s emulator-5556
This script display the next alarm set for an application.
Example :
./alarm_test.sh
./alarm_test.sh -s emulator-5556
This script add or remove the application to the battery optimization list.
Example :
./battery_optimization.sh -p com.android.vending
./battery_optimization.sh -s emulator-5556 -p com.android.vending
./battery_optimization.sh -s emulator-5556 -p com.android.vending -r
./battery_optimization.sh -s emulator-5556 -p com.android.vending -r -d
This script display the bucket level of an application. More information here : https://developer.android.com/topic/performance/appstandby
Example :
./bucket_level.sh -p com.android.vending
./bucket_level.sh -s emulator-5556 -p com.android.vending
This script calculate the hash of all the APKs located in the folder passed in parameter. You can use it with the script calc_hash_device.sh that do the same, but with applications located and extracted from a device.
Example :
./calc_hash_folder.sh /c/apk/
This script activate the UI Light mode.
Example :
./change_ui_mode_light.sh
./change_ui_mode_light.sh -s emulator-5556
This script activate the UI Night mode.
Example :
./change_ui_mode_night.sh
./change_ui_mode_night.sh -s emulator-5556
This script give a status of the applications listed in the _config_apps.sh script:
- Installed or NOT.
- DEBUG/RELEASE mode.
- Backupable or NOT.
Example :
./check_apps_state.sh
This script allow to run other script on a chosen device or on all connected devices.
Example :
./choose_device.sh
This script allow to run other script on a chosen device or on all connected devices, and if on one device you can choose the package.
Example :
./choose_device_and_package.sh
This script allow to run other script on a chosen device or on all connected devices.
Example :
./choose_device.sh
This script allow to run other script and select the package in installed applications on device. Note: Works only if one device is connected. Use choose_device_and_package.sh script if more than one device is connected.
Example :
./choose_package.sh
This script clear the application data.
This script clear the application data.
Example :
./clear_app.sh -p com.android.vending
./clear_app.sh -s emulator-5556 -p com.android.vending
This script clean the applications that are in the _config_apps.sh script.
Example :
./clear_data_apps.sh
./clear_data_apps.sh -s emulator-5556
This script close the applications that are in the list of _config_apps.sh script.
Example :
./close_apps.sh
./close_apps.sh -s emulator-5556
This script delete all the applications of the list defined in _config_apps.sh script.
Example :
./delete_all_apps.sh
./delete_all_apps.sh -s emulator-5556
This script delete the application in parameter. Use with choose_package.sh to get the name of the package.
Example :
./delete_app.sh -p com.android.vending
./delete_app.sh -s emulator-5556 -p com.android.vending
This script display some information about the device.
Example :
./device_info.sh
./device_info.sh -s emulator-5556
This script put the device is DOZE MODE.
Example :
./enter_doze_mode.sh
./enter_doze_mode.sh -p com.android.vending
./enter_doze_mode.sh -s emulator-5556
./enter_doze_mode.sh -s emulator-5556 -p com.android.vending
This script allow to extract an APK from a non-root device.
Example :
./extract_apk.sh
./extract_apk.sh -3
./extract_apk.sh -a
./extract_apk.sh -3 -a
This script generate the documentation for the scripts based on script comments. It's better than maintaining the documentation by hand, isn't it ?
Example :
./generate_md_doc.sh
This script grant all permission for a package.
Example :
./grant_all_permissions.sh -p com.android.vending
./grant_all_permissions.sh -s emulator-5556 -p com.android.vending
This script install all APK in a folder. Use install_apk.sh script.
Example :
./install_all_apk.sh -f /c/apk/
./install_all_apk.sh -s emulator-5556 -f /c/apk/
This script install an application on a device using serial AND file name. Force install in case of:
- Application already installed.
- Downgrade.
- Signature error.
- Test application. If first attempt of install fail, then uninstall the application, and try to install again.
Example :
./install_apk.sh -a /c/apk/Application.apk
./install_apk.sh -s emulator-5556 -a /c/apk/Application.apk
This script allow generating JACOCO report (the Jacoco Broadcast receiver MUST have been integrated in the application).
Example :
./jacoco_extract_code_coverage.sh -p com.android.vending
./jacoco_extract_code_coverage.sh -p com.android.vending -f temp_report.ec
./jacoco_extract_code_coverage.sh -p com.android.vending -f temp_report.ec -d campaign1
This script contain an example to update the password of the keystore and the KeyAlias.
Example :
./keystore_password.sh
This script launch lockito simulation.
Example :
./lockito.sh
./lockito.sh -s emulator-5556
./lockito.sh -s emulator-5556 -l 3
This script remove the appium applications.
Example :
./reset_appium.sh
./reset_appium.sh -s emulator-5556
This script reset the application turn off the Bluetooth and turn off the GPS.
Example :
./reset_test.sh
./reset_test.sh -s emulator-5556
./reset_test.sh -s emulator-5556 -l 3
This script start an application. If the Activity is not filled, then discover by itself.
Example :
./start_app.sh -p fr.dvilleneuve.lockito
./start_app.sh -s emulator-5556 -p fr.dvilleneuve.lockito
./start_app.sh -p fr.dvilleneuve.lockito -a .ui.SplashscreenActivity
./start_app.sh -s emulator-5556 -p fr.dvilleneuve.lockito -a .ui.SplashscreenActivity
This script add or remove the application to the battery optimization list.
Example :
./take_screenshots.sh -f filename
./take_screenshots.sh -s emulator-5556 -f filename