<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2011 The Android Open Source Project 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. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.keychain.tests"> <uses-permission android:name="android.permission.INTERNET"/> <!-- Install the activity and disable battery optimization (so the KeyChainServiceTest can be run in the background): adb install out/target/product/${TARGET_PRODUCT}/data/app/KeyChainTests/KeyChainTests.apk Then navigate to Settings -> Battery -> ... -> Battery optimization -> select All Apps Find com.android.keychain.tests and select Do Not Optimize. Alternatively, the following command can be used to exclude the test services from the background execution restriction for 2 minutes: adb shell cmd deviceidle tempwhitelist -d 120000 com.android.keychain.tests To run service: adb shell am startservice -n com.android.keychain.tests/.KeyChainServiceTest One has to inspect the ADB log to find out about test failures. To run activity: adb shell am start -n com.android.keychain.tests/com.android.keychain.tests.KeyChainTestActivity --> <application> <service android:name="com.android.keychain.tests.KeyChainServiceTest"> <intent-filter> <action android:name="com.android.keychain.tests.KeyChainServiceTest"/> </intent-filter> </service> <activity android:name="com.android.keychain.tests.KeyChainTestActivity"> <intent-filter> <action android:name="com.android.keychain.tests.KeyChainTestActivity"/> </intent-filter> </activity> <activity android:name="com.android.keychain.tests.KeyChainSocketTestActivity"> <intent-filter> <action android:name="com.android.keychain.tests.KeyChainSocketTestActivity"/> </intent-filter> </activity> </application> </manifest>