Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安卓真机path问题 #46

Closed
ftvbftvbq opened this issue May 11, 2016 · 2 comments
Closed

安卓真机path问题 #46

ftvbftvbq opened this issue May 11, 2016 · 2 comments

Comments

@ftvbftvbq
Copy link

  • Macaca Version:
    1.0.24
  • Macaca Doctor:
    正常
  • Platform:
    android 在macaca run后显示错误:
    [init({"platformName":"Android","app":"/NodeJs/Macaca/MXD-IOS-macaca/app/app-debug.apk","udid":"85875fccd2fc08bc"})] The environment you requested was unavailable.
    Error: [init({"platformName":"Android","app":"app/app-debug.apk","udid":"85875fccd2fc08bc"})] The environment you requested was unavailable.

在macaca server --verbose显示的错误:

responseHandler.js:63:12 [master] pid:43223 Send Error Respone to Client: TypeError: Path must be a string. Received undefined
responseHandler.js:69:14 [master] pid:43223 TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.resolve (path.js:426:5)
at Function.ADB.startApp.Promise.getApiLevel.ADB.unInstall.Promise.forceStop.ADB.isInstalled.ADB.isScreenLocked.ADB.waitActivityReady.ADB.killProcess.ADB.getPIds.ADB.getDevices.ADB.getEmulators.ADB.getApkMainifest.promise.then as getApkMainifest
at Android.initDevice.data.filter.Android.getApkInfo (/usr/local/lib/node_modules/macaca-android/lib/macaca-android.js:154:30)
at next (native)
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29)

TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.resolve (path.js:426:5)
at Function.ADB.startApp.Promise.getApiLevel.ADB.unInstall.Promise.forceStop.ADB.isInstalled.ADB.isScreenLocked.ADB.waitActivityReady.ADB.killProcess.ADB.getPIds.ADB.getDevices.ADB.getEmulators.ADB.getApkMainifest.promise.then as getApkMainifest
at Android.initDevice.data.filter.Android.getApkInfo (/usr/local/lib/node_modules/macaca-android/lib/macaca-android.js:154:30)
at next (native)
at onFulfilled (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:65:19)
at /usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:54:5
at Object.co (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:50:10)
at Object.toPromise (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:118:63)
at next (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:99:29)
请问下,如何解决该问题?udid是通过如下代码获取的:
String android_id =Secure.getString(getActivity().getContentResolver(),Secure.ANDROID_ID);
请问是哪个问题导致呢?谢谢!

@ftvbftvbq
Copy link
Author

这个问题,我将这段代码内的app-debug.apk改成了app-debug.apk.zip后没有了:
before(function() {
return driver.init({
platformName: 'Android',
app: path.join(__dirname,'..','app',app-debug.apk.zip),
udid: "85875fccd2fc08bc"
});
});
但是,出现了另外的问题:

socket server ready
socket client ready
responseHandler.js:24:12 [master] pid:43223 Recieve HTTP Request from Client: method: POST url: /wd/hub/session, jsonBody: {"desiredCapabilities":{"platformName":"Android","app":"/NodeJs/Macaca/MXD-IOS-macaca/app/app-debug.apk.zip","udid":"85875fccd2fc08bc","browserName":"firefox","version":"","javascriptEnabled":true,"platform":"ANY"}}
session.js:24:10 [master] pid:43223 Creating session, sessionId: 273221e1-3cee-446e-99d5-8c4a825dd10b.
helper.js:205:12 [master] pid:43223 Unzipping local app form /NodeJs/Macaca/MXD-IOS-macaca/app/app-debug.apk.zip
uiautomator-client.js:78:14 [master] pid:43223 connect lost
INSTRUMENTATION_STATUS: numtests=1

INSTRUMENTATION_STATUS: stream=
com.android.uiautomator.client.Initialize:
INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
INSTRUMENTATION_STATUS: test=testStartServer
INSTRUMENTATION_STATUS: class=com.android.uiautomator.client.Initialize
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1

uiautomator start socket server.

socket server ready
socket client ready
responseHandler.js:63:12 [master] pid:43223 Send Error Respone to Client: Wait For Condition timeout 60000

InternalServerError: Internal Server Error
at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-cli/node_modules/koa/lib/context.js:91:23)
at Object.module.exports (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/responseHandler.js:66:17)
at throw (native)
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)
at process._tickCallback (node.js:401:9)

responseHandler.js:63:12 [master] pid:43223 Send Error Respone to Client: Wait For Condition timeout 60000

InternalServerError: Internal Server Error
at Object.module.exports.throw (/usr/local/lib/node_modules/macaca-cli/node_modules/koa/lib/context.js:91:23)
at Object.module.exports (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/responseHandler.js:66:17)
at throw (native)
at onRejected (/usr/local/lib/node_modules/macaca-cli/node_modules/co/index.js:81:24)
at process._tickCallback (node.js:401:9)

responseHandler.js:24:12 [master] pid:43223 Recieve HTTP Request from Client: method: DELETE url: /wd/hub/session, jsonBody: {}
responseHandler.js:32:14 [master] pid:43223 Send HTTP Respone to Client: 405 Method Not Allowed
uiautomator-client.js:78:14 [master] pid:43223 connect lost

@xudafeng
Copy link
Member

"app":"app/app-debug.apk" 路径没找到啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants