• 另外,安卓版本是否低于 5.0,2 对低版本支持不好

  • 感谢,我的手机确是 4.4.2,有时间找个高版本手机试一下

  • 中文的可以

  • 第六步出现了权限问题,按照提示执行如下脚本修复:

    ···
    sudo chmod 777 /usr/local/lib/node_modules
    ···

  • 感谢。

    把我安装过程中的一些错误纪录一下:

    第七步:

    JamesdeiMac:~ jameslee$ cnpm install -g ios-deploy
    Downloading ios-deploy to /usr/local/lib/node_modules/ios-deploy_tmp
    Copying /usr/local/lib/node_modules/ios-deploy_tmp/_ios-deploy@1.9.2@ios-deploy to /usr/local/lib/node_modules/ios-deploy
    Installing ios-deploy's dependencies to /usr/local/lib/node_modules/ios-deploy/node_modules
    scripts.preinstall ios-deploy@1.9.2  "./src/scripts/check_reqs.js && xcodebuild"
    stderr: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
    
    Install fail! Error: Run "sh -c ./src/scripts/check_reqs.js && xcodebuild" error, exit code 1
    Error: Run "sh -c ./src/scripts/check_reqs.js && xcodebuild" error, exit code 1
        at ChildProcess.proc.on.code (/usr/local/lib/node_modules/cnpm/node_modules/runscript/index.js:74:21)
        at emitTwo (events.js:106:13)
        at ChildProcess.emit (events.js:191:7)
        at maybeClose (internal/child_process.js:877:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
    npminstall version: 3.2.1
    npminstall args: /usr/local/bin/node /usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js --china --userconfig=/Users/jameslee/.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=http://registry.npm.taobao.org -g ios-deploy
    

    我的 Mac 上 xcode 和命令行工具都有, 网上 google 了一下,执行如下命令:
    ···
    sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
    ···

    然后继续安装就成功了。

  • 请大神们指点

  • 兄弟这个问题解决了没?

    我也遇上同样的问题了, java-client 5.0.4 + appium desktop 1.2.4 , 也是输入不了密码

            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability("deviceName", "Andorid Emulator");
            capabilities.setCapability("automationName", "uiautomator2");
            capabilities.setCapability("platformName", "Android");
            capabilities.setCapability("platformVersion", "4.4.2");
            capabilities.setCapability("appPackage", "com.test.doctor");
            capabilities.setCapability("appActivity", ".user.UserLoginActivity");
            capabilities.setCapability("newCommandTimeout", 0);
    //        capabilities.setCapability("unicodeKeyboard", true);
    //        capabilities.setCapability("resetKeyboard", true);
    
            URL url = new URL("http://127.0.0.1:4723/wd/hub");
            driver = new AndroidDriver(url, capabilities);
            driver.manage().timeouts().implicitlyWait(sleepInterval, TimeUnit.SECONDS);
    

    Appium-desktop 异常为:

    [JSONWP Proxy] Proxying [POST /element/915615d6-5bad-40d6-874d-f9f8e30bf6ae/value] to [POST http://localhost:8200/wd/hub/session/935da85d-9bce-4b0c-a8bd-f9447cb7ba9b/element/915615d6-5bad-40d6-874d-f9f8e30bf6ae/value] with body: {"elementId":"915615d6-5bad-40d6-874d-f9f8e30bf6ae","text":"88888","replace":false}
    [MJSONWP] Encountered internal error running command:  {"jsonwp":{"value":"java.lang.NullPointerException
    at android.support.test.uiautomator.UiObject2.setText(UiObject2.java:601)
    at io.appium.uiautomator2.model.UiObject2Element.setText(UiObject2Element.java:129)
    at io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:83)
    at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56)
    at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:202)
    at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:193)
    at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:514)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    at java.lang.Thread.run(Thread.java:841)\n","status":13,"sessionId":"935da85d-9bce-4b0c-a8bd-f9447cb7ba9b"}} ProxyRequestError: Could not proxy command to remote server. Original error: 500 - {"value":"java.lang.NullPointerException
    at android.support.test.uiautomator.UiObject2.setText(UiObject2.java:601)
    at io.appium.uiautomator2.model.UiObject2Element.setText(UiObject2Element.java:129)
    at io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:83)
    at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56)
    at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:202)
    at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:193)
    at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:514)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:468)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    at java.lang.Thread.run(Thread.java:841)\n","status":13,"sessionId":"935da85d-9bce-4b0c-a8bd-f9447cb7ba9b"}
        at JWProxy.proxy$ (C:\Users\tomavis\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:152:13)
        at tryCatch (C:\Users\tomavis\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
        at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\tomavis\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22)
        at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\tomavis\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:100:21)
        at GeneratorFunctionPrototype.invoke (C:\Users\tomavis\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
    [HTTP] <-- POST /wd/hub/session/0b05d808-949c-413a-b7ac-3d2665f10ee5/element/915615d6-5bad-40d6-874d-f9f8e30bf6ae/value 500 563 ms - 3444 
    
  • 小弟新手,我使用的代码如下:
    driver.findElement(By.xPath("//android.view.View[@content-desc='业务说明']");

    这里要注意的是有时候 业务说明 这几个字后面会有空格, 不知道是不是开发人员无意弄得.

  • 推荐个淘宝视频?

  • 安装个 python 的开发工具,类似于 pycharm 之类,然后在里面选择包安装,能安装 http。client 吗?