C:\WINDOWS\system32>macaca doctor
macaca-doctor version: 2.0.1
Node.js checklist:
node env: C:\nodejs\node.exe
node version: v4.4.7 lower than v6.9.2
Android checklist:
JAVA version is 1.8.0_91
JAVA_HOME is set to C:\Program Files\Java1.8\jdk1.8.0_91
ANDROID_HOME is set to C:\macaca\android-sdk_r24.4.1-windows\android-sdk-windows
Platforms is set to C:\macaca\android-sdk_r24.4.1-windows\android-sdk-windows\platforms\android-25
ADB tool is set to C:\macaca\android-sdk_r24.4.1-windows\android-sdk-windows\platform-tools\adb.exe
GRADLE_HOME is set to C:\macaca\gradle-3.5-all\gradle-3.5
Installed driver list:
android: 2.0.23
chrome: 1.0.5
electron: 1.1.6
执行脚本的 setup()方法
@Before
public void setUp() throws Exception {
//Logger logger = Logger.getLogger(getClass());
JSONObject porps = new JSONObject();
porps.put("autoAcceptAlerts", true);
porps.put("javascriptEnabled", true);
porps.put("platformVersion", "4.4");
porps.put("deviceName", "Android");
porps.put("platformName", "android");
porps.put("udid", "0715f7d953bc0634");
//porps.put("app", "D:/workspace/AppTest/apps/weixin_1041.apk");
porps.put("reuse", 3);
porps.put("package", "com.tencent.mm");
porps.put("activity", ".ui.LauncherUI");
//porps.put("androidProcess", "com.tencent.mm:appbrand0");
JSONObject desiredCapabilities = new JSONObject();
//desiredCapabilities.put("host", "192.168.0.230"); // custom server host
//desiredCapabilities.put("port", 3456); // custom server port
desiredCapabilities.put("desiredCapabilities", porps);
driver.initDriver(desiredCapabilities);
}
macaca server 错误:
responseHandler.js:11:12 [master] pid:2688 Recieve HTTP Request from Client[2017-07-10 14:40:17]: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"app":"https://npmcdn.com/android-app-bootstrap@latest/android_app_bootstrap/build/outputs/apk/android_app_bootstrap-debug.apk,reuse:1,platformName:android}"}
session.js:47:10 [master] pid:2688 Creating session, sessionId: b0639ec9-0774-4cfd-b183-9814cbcbc09f.
get C:\Users\dxl.macaca-temp\android_app_bootstrap-debug.apk from cache
sha:9656cdf14170f899681bebe9d58a1de4
helper.js:208:12 [master] pid:2688 Using local app form C:\Users\dxl.macaca-temp\android_app_bootstrap-debug.apk
uiautomator-client.js:56:14 [master] pid:2688 INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{com.macaca.android.testing.test/android.support.test.runner.AndroidJUnitRunner}uiautomator-client.js:56:14 [master] pid:2688 INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: com.macaca.android.testing.test/android.support.test.runner.AndroidJUnitRunner
at com.android.commands.am.Am.runInstrument(Am.java:1121)
at com.android.commands.am.Am.onRun(Am.java:374)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:103)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:257)