{"id":13770763,"url":"https://github.com/KazuCocoa/DroidTestHelper","last_synced_at":"2025-05-11T03:32:54.210Z","repository":{"id":143255288,"uuid":"51636633","full_name":"KazuCocoa/DroidTestHelper","owner":"KazuCocoa","description":"Helper application to test android applications. This application handles some settings via adb broadcast.","archived":false,"fork":false,"pushed_at":"2019-02-07T16:55:46.000Z","size":9294,"stargazers_count":14,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T11:49:06.679Z","etag":null,"topics":["adb-broadcast","android","change-animations","testing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KazuCocoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-02-13T07:25:22.000Z","updated_at":"2023-12-02T02:16:37.000Z","dependencies_parsed_at":"2024-01-07T21:02:11.830Z","dependency_job_id":"d3d1d2ee-3cc9-4a79-b2b1-fd264d4bde9b","html_url":"https://github.com/KazuCocoa/DroidTestHelper","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KazuCocoa%2FDroidTestHelper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KazuCocoa%2FDroidTestHelper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KazuCocoa%2FDroidTestHelper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KazuCocoa%2FDroidTestHelper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KazuCocoa","download_url":"https://codeload.github.com/KazuCocoa/DroidTestHelper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb-broadcast","android","change-animations","testing"],"created_at":"2024-08-03T17:00:41.728Z","updated_at":"2025-05-11T03:32:53.523Z","avatar_url":"https://github.com/KazuCocoa.png","language":"Kotlin","funding_links":[],"categories":["E2E Test"],"sub_categories":["Helper"],"readme":"# DroidTestHelper\n\n[![Build Status](https://www.bitrise.io/app/6841fdd15c749475.svg?token=q73f-gNh1bFHCjbSgn9h-A\u0026branch=master)](https://www.bitrise.io/app/6841fdd15c749475)\n\nHelper application to test android applications. This application handle some settings via adb broadcast.\nSo, you can handle some settings via adb broadcast.\n\nSome features are similar to https://github.com/linkedin/test-butler published by LinkedIn.\n\n# Feature\n\n- Remove particular account from AccountManager via `adb` broadcast.\n    - You can remove application local data via `adb shell am clear your.package.name`.\n    - But if your application support account manager, the command can't remove the data.\n- Change language/country setting via some adb commands\n- Change animation scale\n- Clear data\n\n# How to use\n\n- 1. Git clone this repository, build and install this apk into your target device.\n    - run the apk once\n    - `$ adb shell am start -n com.kazucocoa.droidtesthelper/.MainActivity`\n\n## remove account from account manager\n\n- 2. Execute the following command. ( Should replace `your.target.account.type` to fit your application. )\n    - `$ adb shell am broadcast -a 'DroidTestHelper' --es ACCOUNT_TYPE your.target.account.type`\n    - Managing account only for API level 22 and lower.\n    - If you clone this repository and build apk with the same signature for your test target apk, you can manage the account without permissions.\n        - https://github.com/KazuCocoa/DroidTestHelper/issues/25#issuecomment-350422302\n\n## change locale\n\n- 2. Execute the following command to allow permission.\n    - ```$ adb shell pm grant com.kazucocoa.droidtesthelper android.permission.CHANGE_CONFIGURATION```\n- 3. Set `ja_JP`\n    - ```$ adb shell am broadcast -a 'DroidTestHelper' --es LANG ja --es COUNTRY JP```\n\n### reference\n- https://developer.android.com/reference/java/util/Locale.html\n- http://stackoverflow.com/questions/7973023/what-is-the-list-of-supported-languages-locales-on-android\n\n## Change animations\n\n- 2. Execute the following command to allow permission.\n    - ```$ adb shell pm grant com.kazucocoa.droidtesthelper android.permission.SET_ANIMATION_SCALE```\n    - ```$ adb shell pm grant com.kazucocoa.droidtesthelper android.permission.WRITE_SECURE_SETTINGS```\n- 3. enable/disable animation scale 1.0f\n    - enable\n        - ```$ adb shell am broadcast -a 'DroidTestHelper' --ez ANIMATION true```\n    - disable\n        - ```$ adb shell am broadcast -a 'DroidTestHelper' --ez ANIMATION false```\n\n## Clear Data\n\n- 2. clear data (Requires API level 21+)\n    - ```$ adb shell am broadcast -a 'DroidTestHelper' --es CLEAR_DATA com.example```\n\n# DroidTestHelperLib\n\n- HandleAccountHelper\n- HandleAnimations\n- HandleLocale\n- HandlePermission\n- HandleClearData\n\n## Embedded DroidTestHelperLib into your library\n### from Jitpack\n- https://jitpack.io/#KazuCocoa/DroidTestHelper\n ```\ndependencies {\n    compile 'com.github.KazuCocoa:DroidTestHelper:0.3.0'\n}\n```\n\n### Need Permissions to enable the above handler in AndroidManifest.xml\n\n```xml\n    \u003cuses-permission android:name=\"android.permission.GET_ACCOUNTS\" android:maxSdkVersion=\"22\"/\u003e\n\n    \u003cuses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/\u003e\n    \u003cuses-permission android:name=\"android.permission.SET_ANIMATION_SCALE\"/\u003e\n    \u003cuses-permission android:name=\"android.permission.WRITE_SECURE_SETTINGS\"/\u003e\n\n    \u003c!-- to grant permission --\u003e\n    \u003cuses-permission android:name=\"android.permission.GRANT_REVOKE_PERMISSIONS\"/\u003e\n\n    \u003cuses-permission\n        android:name=\"android.permission.MANAGE_ACCOUNTS\"\n        android:maxSdkVersion=\"22\" /\u003e\n```\n\n### Implementations\n\nA package `com.kazucocoa.droidtesthelper` is example to use `com.kazucocoa.droidtesthelperlib`.\n\n# Note for Android P\n- Android P has `Restrictions on non-SDK interfaces` feature.\n    - https://developer.android.com/preview/restrictions-non-sdk-interfaces\n- `java.lang.NoSuchMethodException: setAnimationScales [class [F]` happen when we call `setAnimationScales` in animation handler\n\n- To available the interface, we need below adb commands\n    ```\n    adb shell settings put global hidden_api_policy_pre_p_apps  1\n    adb shell settings put global hidden_api_policy_p_apps 1\n    ```\n- To disable again, we need below adb commands\n    ```\n    adb shell settings delete global hidden_api_policy_pre_p_apps\n    adb shell settings delete global hidden_api_policy_p_apps\n    ```\n\n\n# load map\n\nI will add additional feature if I need.\n\n# LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKazuCocoa%2FDroidTestHelper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKazuCocoa%2FDroidTestHelper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKazuCocoa%2FDroidTestHelper/lists"}