Detail Steps Setting Up Android Devices Compatibility Tests

1 篇文章 0 订阅
- Preparations
  . One Android device (MID, mobile, etc.)
  . USB cable

  . Android SDK (Linux)                                  ; The SDK version should match to your device

     http://dl.google.com/android/android-sdk_r18-linux.tgz

       Android-sdk_r08-linux.tgz for SDK2.3

Linux
http://dl.google.com/android/repository/tools_r17-linux.zip
Size: 30MB
SHA1: d6b277bb6a02d4c0084d313eb502a939418cc51a
Windows
http://dl.google.com/android/repository/tools_r17-windows.zip
Size: 37MB
SHA1: 1af73b6f4ebf71b0b58f9c044ed1d8d351153512
Mac
http://dl.google.com/android/repository/tools_r17-macosx.zip
34M
SHA1: 31f3c9cf16319071e55b6dd3d2502a9afa409e85
Linux
http://dl.google.com/android/repository/platform-tools_r11-linux.zip
Size: 10MB
SHA1: 3d12586a1d83d5ad068c017edf60ab165f251305
Windows
http://dl.google.com/android/repository/platform-tools_r11-windows.zip
Size: 10MB
SHA1: 9a35e21735515167e1c39f5a17cb705c3b4c821a
Mac
http://dl.google.com/android/repository/platform-tools_r11-macosx.zip

  . Android CTS and CTS media files {The CTS version should match to your device}

     http://source.android.com/compatibility/downloads.html

  . Environments
    > z4root (Root the Android device firstly if you need)
      http://forum.xda-developers.com/attachment.php?attachmentid=446145&d=1290341328 [^]
    > /etc/udev/rules.d/51-android.rules
    > $(CTS_ROOT)/repository/host_config.xml
       ; Modify the item: <IntValue name="maxTestCount" value="200" /> to <IntValue name="maxTestCount" value="-1" />
    > ENV virables
      >> export SDK_ROOT=~/android-sdk-linux
      >> export PATH=${SDK_ROOT}/platform-tools:${SDK_ROOT}/tools:$PATH
      >> export CTS_ROOT=~/Downloads/android-cts

- Android device's preparations
This section is important as not following these instructions will lead to test timeouts/failures:
  1. Your phone should be running a user build (Android 4.0 and later) from source.android.com
  2. Please refer to this link on the Android developer site and set up your device accordingly.
  3. Make sure that your device has been flashed with a user build (Android 4.0
and later) before you run CTS.
  4. You need to ensure the Text To Speech files are installed on the device. You can check via Settings > Speech synthesis > Install voice data before running CTS tests. (Note that this assumes you have Android Market installed on the device, if not you will need to install the files manually via adb)
  5. Make sure the device has a SD card plugged in and the card is empty. Warning: CTS may modify/erase data on the SD card plugged in to the device.
  6. Do a factory data reset on the device (Settings > SD Card & phone storage >
Factory data reset). Warning: This will erase all user data from the phone.
  7. Make sure no lock pattern is set on the device (Settings > Security > Screen Lock should be 'None').
  8. Make sure the "USB Debugging" development option is checked (Settings >
Developer options > USB debugging).
  9. Make sure Settings > Developer options > Stay Awake is checked
  10. Make sure Settings > Developer options > Allow mock locations is checked
  11. Make sure device is connected to a functioning Wi-Fi network (Settings > Wi-Fi)
  12. Make sure the device is at the home screen at the start of CTS (Press the
home button).
  13. While a device is running tests, it must not be used for any other tasks.
  14. Do not press any keys on the device while CTS is running. Pressing keys or touching the screen of a test device will interfere with the running tests and may lead to test failures.
  15. Set up accessibility tests:
    1. adb install android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
    2. On the device, enable Settings > Accessibility > Delegating Accessibility Service
  16. Set up device administration tests:
    1. adb install android-cts/repository/testcases/CtsDeviceAdmin.apk
    2. On the device, enable Settings > Security > Device Administrators > android.deviceadmin.cts.CtsDeviceAdmin* settings


- Steps
  . Connect your Android device to your Linux PC
  . Check the debug connection
    > lsusb ; You'll see
      Bus 001 Device 006: ID 0bb4:0c01 High Tech Computer Corp. Dream / ADP1 / G1 Phone
    > adb devices
      List of devices attached 
      ???????????? no permissions                                  ; If this case, you need to restart adb sevice as root
    > adb kill-server
    > sudo $(SDK_ROOT)/platform-tools/adb start-server
    > adb devices
      List of devices attached 

      0123456789ABCDEF device

  . setup your device (or emulator) to run the accessibility tests 

    > adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
      97 KB/s (7867 bytes in 0.079s)
      pkg: /data/local/tmp/CtsDelegatingAccessibilityService.apk
      Success

    > On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service

        ; Different Android SDK might has minor differences. More detailed information, please visit:

         http://source.android.com/compatibility/cts-intro.html

  . Launch the CTS / run test plan / check the test results

    > android-cts/tools/startcts ; Lanch to CTS_HOST
    > ls --plan
      List of plans (8 in total):
        VM
        Performance
        Java
        Signature
        Android
        RefApp
        AppSecurity
        CTS
    > start --plan CTS                                           ; Choose one of them to test, waiting for a long times ....

    > ls -r                                                            ; Check the test results

       The test results are placed in the file: $CTS_ROOT/repository/results/<start time>.zip
        Inside the zip, the testResult.xml file contains the actual results -- open this file 
in any web browser (Firefox 3.x recommended) to view the test results.


Refer to Android official document: Android-CTS-manual


$ cat /etc/udev/rules.d/51-android.rules 
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="kkkk"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="kkkk"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="kkkk"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="kkkk"


# /etc/udev/rules.d/51-android.rules
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="kkkk"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="kkkk"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="kkkk"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="kkkk"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="kkkk"
# fastboot protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="708c", MODE="0600", OWNER="kkkk"
# adb protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0600", OWNER="kkkk"
# fastboot protocol on maguro/toro (Galaxy Nexus)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e30", MODE="0600", OWNER="kkkk"
# adb protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d101", MODE="0600", OWNER="kkkk"
# fastboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0600", OWNER="kkkk"


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值