如何编译谷歌压力应用程序为Android x86手机



步骤 (1) 下载源代码

svn checkout http://stressapptest.googlecode.com/svn/trunk/ stressapptest

步骤(2)如何为Android x86手机编译上述代码?

答案 我不可用。

步骤(3)如何安装?

adb push stressapptest /data/local/tmp/
adb shell chmod 777  /data/local/tmp/stressapptest
adb shell /data/local/tmp/stressapptest

步骤(4)如何运行? 用户指南 : https://code.google.com/p/stressapptest/wiki/UserGuide

示例命令行

./stressapptest -s 20 -M 256 -m 8 -C 8 -W # Allocate 256MB of memory and run 8 "warm copy" threads, and 8 cpu load threads. Exit after 20 seconds.
./stressapptest -f /tmp/file1 -f /tmp/file2 # Run 2 file IO threads, and autodetect memory size and core count to select allocated memory and memory copy threads.

问题是:如何为安卓x86手机编译上面的代码?

使用 Android NDK

您可以使用 NDK 编译可执行文件,您的 Android.mk 文件有一个包含 $(BUILD_EXECUTABLE) 语句。(已包含在源文件中)。

步骤

  1. 将整个源文件放在jni文件夹中(如果不存在,则创建。

  2. 创建 Aplication.mk 文件。

APP_STL := stlport_static APP_ABI := x86 APP_PLATFORM := android-18

  1. 编辑 stressapptest_config_android.h 文件

    • 取消注释 #undef STRESSAPPTEST_CPU_I686 并将 #undef 替换为 #define。
    • 评论 #define STRESSAPPTEST_CPU_ARMV7A
  2. 使用 ndk-build 命令编译 stressapptest 文件夹。
  3. 在lib\x86文件夹中,您将获得压力应用程序测试
  4. 下一步如问题所示

最新更新