Windowsでコマンドラインを使用してCTSを起動するにはどうすればよいですか?

StackOverflow https://stackoverflow.com/questions/8829316

  •  27-10-2019
  •  | 
  •  

質問

Android 2.3の場合、次のコマンドラインを使用してCTSコンソールに入ります:

java -Xmx512M -cp %CTS_ROOT%\ tools \ ddmlib-prebuilt.jar;%CTS_ROOT%\ tools \ cts.jar;%CTS_ROOT%\ tools \ junit.jar; %CTS_ROOT%\ tools \ hosttestlib.jar com.android.cts.TestHost %CTS_ROOT%\ repository / host_config.xml

cygwinのようなものなしでこのようなAndroid4.0 CTSを実行する同様の方法はありますか?

役に立ちましたか?

解決

WindowsでAndroid4.0以降のCTSを実行する場合

これが私の解決策です:(すべてのpath(adb)/ classpath(Java)が正しく設定されていると思います)

1.CTSファイルをダウンロードして解凍します(たとえば、解凍したすべてのファイルをD:\ ctsに入れます。フォルダーは、D:\ cts \ android-ctsのようになります)

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

2. cts_windows.batファイルを作成し、toolsフォルダーに配置します。 (私の場合はD:\ cts \ android-cts \ tools \ cts_windows.batです)

以下のコードでcts_windows.batファイルを編集します(独自の-DCTS_ROOTパスを使用することを忘れないでください): ジェネラコディセタグプレ

  1. cts_windows.batファイルを実行すると、「cts-tf>」のようなシェルになります。 次に、「run cts --planCTS」コマンドを使用してctsを実行できます。

    詳細な手順については、次のマニュアルをお読みください。 http://source.android.com/compatibility/android-cts-manual-r4.pdf

他のヒント

For the 4.1 CTS Suite I performed different tasks that resolved my issue.

For windows users running Cygwin:

  1. Modify JAR_PATH setup on line 81, replace the colon with a semi-colon.
    Also add quotes around the assignment. It should look like the command below:

    Bad: JAR_PATH=${JAR_PATH}:${JAR_DIR}/${JAR}
    Good: JAR_PATH="${JAR_PATH};${JAR_DIR}/${JAR}"

  2. Be sure to run the cts-tradefed script inside the same directory!
    Line 73 assumes if CTS_ROOT is not defined then the user is in the same directory as cts-tradefed.
    But the instructions tell the person to run the script from the directory cts-android is in.


    Good: ./cts-tradefed
    Bad: ./android-cts/tools/tradefed

Am able to run CTS on Windows, The above Exception is resolved by passing the proper CTS root directory.

By default CTS refers android-cts as root directory, So we should maintain folder as "D:\Android\android-cts"

Pass -DCTS_ROOT=D:\Android

So " Caused by: java.io.FileNotFoundException: CTS install folder D:\cts\android-cts " will be resolved.

java -cp ddmlib-prebuilt.jar;tradefed-prebuilt.jar;hosttestlib.jar;cts-tradefed.jar -DCTS_ROOT=D:\Android com.android.cts.tradefed.command.CtsConsole

With above script am able to RUN CTS on my user device.

Thanks., Ganesh Kumar Ramamoorthy

I wouldn't recommend to run CTS on Windows.

Until Android 4+, the use of workaround suggested here (use batch file) did worked but when I've tried it, there were many failures and many tests even not executed at all. Also, according to Google CTS documentation, it should run on Linux or MAC only so how you can guarantee that failures are because of the device under test (real failure), or because you're running it in not supported environment?

Nevertheless, as of Android 6+, the use of batch file in Windows didn't worked for me, CTS will look for bash which exists only in Linux machine and will quit the execution before it starts.

When try to run in on Linux it runs beautifully.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top