Helper application to test android applications. This application handles some settings via adb broadcast.
MIT License
Helper application to test android applications. This application handle some settings via adb broadcast. So, you can handle some settings via adb broadcast.
Some features are similar to https://github.com/linkedin/test-butler published by LinkedIn.
adb
broadcast.
adb shell am clear your.package.name
.$ adb shell am start -n com.kazucocoa.droidtesthelper/.MainActivity
your.target.account.type
to fit your application. )$ adb shell am broadcast -a 'DroidTestHelper' --es ACCOUNT_TYPE your.target.account.type
$ adb shell pm grant com.kazucocoa.droidtesthelper android.permission.CHANGE_CONFIGURATION
ja_JP
$ adb shell am broadcast -a 'DroidTestHelper' --es LANG ja --es COUNTRY JP
$ adb shell pm grant com.kazucocoa.droidtesthelper android.permission.SET_ANIMATION_SCALE
$ adb shell pm grant com.kazucocoa.droidtesthelper android.permission.WRITE_SECURE_SETTINGS
$ adb shell am broadcast -a 'DroidTestHelper' --ez ANIMATION true
$ adb shell am broadcast -a 'DroidTestHelper' --ez ANIMATION false
$ adb shell am broadcast -a 'DroidTestHelper' --es CLEAR_DATA com.example
dependencies {
compile 'com.github.KazuCocoa:DroidTestHelper:0.3.0'
}
<uses-permission android:name="android.permission.GET_ACCOUNTS" android:maxSdkVersion="22"/>
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
<!-- to grant permission -->
<uses-permission android:name="android.permission.GRANT_REVOKE_PERMISSIONS"/>
<uses-permission
android:name="android.permission.MANAGE_ACCOUNTS"
android:maxSdkVersion="22" />
A package com.kazucocoa.droidtesthelper
is example to use com.kazucocoa.droidtesthelperlib
.
Android P has Restrictions on non-SDK interfaces
feature.
java.lang.NoSuchMethodException: setAnimationScales [class [F]
happen when we call setAnimationScales
in animation handler
To available the interface, we need below adb commands
adb shell settings put global hidden_api_policy_pre_p_apps 1
adb shell settings put global hidden_api_policy_p_apps 1
To disable again, we need below adb commands
adb shell settings delete global hidden_api_policy_pre_p_apps
adb shell settings delete global hidden_api_policy_p_apps
I will add additional feature if I need.
MIT