• 大神麻烦问一下,构建过程中 cese 运行成功,但是报告报错:

    运行 UI 自动化时,生成 Allure 报告报错,“java.io.IOException: Can't find allure commandline”

    是我哪块少配置了吗

  • 谢谢,给我了启发,经查询得知文章链接,需要在容器中的~/.bashrc 文件中添加alias python='/usr/bin/python3.4'即可。🙏 多谢啦。

  • 仅楼主可见
  • 重新安装 1.10.0 版本的就可以了没问题了,网上查找了一下,好像说是路径的问题,之前我的 appium1.9.1 放在路径【/usr/local/bin/appium】下面,但是这次重装的路径在【/Users/个人账户/.nvm/versions/node/v10.15.0/lib/node_modules/appium/node_modul】个人账户路径下,参考文章:https://blog.csdn.net/lsp84ch80/article/details/81214705

  • 下面是我的具体操作:
    1、先卸载 Mac 中的 appium:npm unistall -g appium
    2、查看电脑中还有没有 appium:appium -v
    3、如果第二步还存在说明 appium 安装到其他目录下了,查看 appium 路径:which appium
    此时可能会输出路径为【/usr/local/bin/appium】,进到这个目录下手动删除 appium 文件夹
    4、再输入:appium -v,此时应该就没有

    zsh: command not found: appium
    

    5、再重新安装 appium 指定版本:cnpm install -g appium@1.10.0
    6、再输入:appium -v,此时应该就有

    1.10.0
    

    7、最后启动 appium 服务,运行代码就不报错了,并且可以获取到 Toast 信息了
    8、java 代码:

    @BeforeClass
        public static void beforeClass() throws MalformedURLException {
            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability("platformName","android");
            capabilities.setCapability("deviceName","emulator-5554");
            capabilities.setCapability("appPackage","com.example.android.apis");
            capabilities.setCapability("appActivity",".ApiDemos");
    
    
            **只加了这一行,没有加【capabilities.setCapability("noReset",true);**
            capabilities.setCapability("automationName","uiautomator2");
    
    
            // driver实例
            driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
            driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
        }
    
  • 感谢,查找了半天没找到原因,原来是我 appium 安装路径的问题,以前没有安装在个人账户下

  • 我看了一下,有这两个 apk 包

  • 意思是他自动下载的 apk 包失败是吗

  • [debug] [W3C] Calling AppiumDriver.createSession() with args: [{"appActivity":".ApiDemos","appPackage":"com.example.android.apis","automationName":"Uiautomator2","platformName":"Android","deviceName":"emulator-5554"},null,{"alwaysMatch":{"appium:appActivity":".ApiDemos","appium:appPackage":"com.example.android.apis","appium:automationName":"Uiautomator2","appium:deviceName":"emulator-5554","platformName":"android"},"firstMatch":[{}]}]
    [debug] [BaseDriver] Event 'newSessionRequested' logged at 1548926366177 (17:19:26 GMT+0800 (GMT+08:00))
    [Appium] Creating new AndroidUiautomator2Driver (v1.19.0) session
    [Appium] Capabilities:
    [Appium]   platformName: android
    [Appium]   appActivity: .ApiDemos
    [Appium]   appPackage: com.example.android.apis
    [Appium]   automationName: Uiautomator2
    [Appium]   deviceName: emulator-5554
    [debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"appActivity":".ApiDemos",... were provided
    [debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
    [BaseDriver] Session created with session id: 4cb8465d-adf7-422c-bb9d-7257240150b0
    [AndroidDriver] Java version is: 1.8.0_181
    [AndroidDriver] Retrieving device list
    [debug] [ADB] Trying to find a connected android device
    [debug] [ADB] Getting connected devices...
    [debug] [ADB] 1 device(s) connected
    [AndroidDriver] Using device: emulator-5554
    [debug] [ADB] Setting device id to emulator-5554
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk'
    [debug] [ADB] Current device property 'ro.build.version.sdk': 24
    [debug] [ADB] Device API level: 24
    [AndroidDriver] No app sent in, not parsing package/activity
    [ADB] Getting device platform version
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.build.version.release'
    [debug] [ADB] Current device property 'ro.build.version.release': 7.0
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm size'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell wm density'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.product.model'
    [debug] [ADB] Current device property 'ro.product.model': Android SDK built for x86
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell getprop ro.product.manufacturer'
    [debug] [ADB] Current device property 'ro.product.manufacturer': Google
    [debug] [ADB] Device API level: 24
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop io.appium.uiautomator2.server'
    [debug] [ADB] Checking app cert for /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk
    [debug] [ADB] Starting '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/build-tools/28.0.3/apksigner' with args '["verify","--print-certs","/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk"]'
    [debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
    [debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
    [debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
    [debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
    [debug] [ADB] WARNING: META-INF/INDEX.LIST not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
    [debug] [ADB] WARNING: META-INF/io.netty.versions.properties not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
    [debug] [ADB]
    [debug] [ADB] '/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' is already signed.
    [debug] [ADB] Checking app cert for /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk
    [debug] [ADB] Starting '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/build-tools/28.0.3/apksigner' with args '["verify","--print-certs","/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk"]'
    [debug] [ADB] apksigner stdout: Signer #1 certificate DN: EMAILADDRESS=android@android.com, CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US
    [debug] [ADB] Signer #1 certificate SHA-256 digest: a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc
    [debug] [ADB] Signer #1 certificate SHA-1 digest: 61ed377e85d386a8dfee6b864bd85b0bfaa5af81
    [debug] [ADB] Signer #1 certificate MD5 digest: e89b158e4bcf988ebd09eb83f5378e87
    [debug] [ADB]
    [debug] [ADB] '/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' is already signed.
    [debug] [ADB] Getting install status for io.appium.uiautomator2.server
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm list packages io.appium.uiautomator2.server'
    [debug] [ADB] App is installed
    [debug] [ADB] Getting package info for 'io.appium.uiautomator2.server'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server'
    [debug] [ADB] The installed 'io.appium.uiautomator2.server' package does not require upgrade ('1.18.0' >= '1.18.0')
    [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm list packages io.appium.uiautomator2.server.test'
    [debug] [ADB] App is installed
    [debug] [ADB] Getting package info for 'io.appium.uiautomator2.server.test'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.uiautomator2.server.test'
    [ADB] Cannot read version codes of '/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' and/or 'io.appium.uiautomator2.server.test'
    [ADB] Cannot read version names of '/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk' and/or 'io.appium.uiautomator2.server.test'. Assuming correct app version is already installed
    [debug] [UiAutomator2] Waiting up to 20000ms for instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' to be available
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm list instrumentation'
    [debug] [UiAutomator2] Instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' available
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 wait-for-device'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell echo ping'
    [debug] [AndroidDriver] Pushing settings apk to device...
    [debug] [ADB] Getting install status for io.appium.settings
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm list packages io.appium.settings'
    [debug] [ADB] App is installed
    [debug] [ADB] Getting package info for 'io.appium.settings'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.settings'
    [debug] [ADB] The installed 'io.appium.settings' package does not require upgrade (13 > 5)
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell ps'
    [debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
    [debug] [ADB] Device API level: 24
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell appops set io.appium.settings android\:mock_location allow'
    [AndroidDriver] setDeviceLanguageCountry requires language or country.
    [AndroidDriver] Got language: 'null' and country: 'null'
    [debug] [Logcat] Starting logcat capture
    [debug] [AndroidDriver] Pushing unlock helper app to device...
    [debug] [ADB] Getting install status for io.appium.unlock
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm list packages io.appium.unlock'
    [debug] [ADB] App is installed
    [debug] [ADB] Getting package info for 'io.appium.unlock'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.unlock'
    [debug] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')
    [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
    [debug] [ADB] Forwarding system: 8200 to device: 6790
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward tcp\:8200 tcp\:6790'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell rm -rf /data/local/tmp/strings.json'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell pm path com.example.android.apis'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 pull /data/app/ApiDemos/ApiDemos.apk /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/T/com.example.android.apis.apk'
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 pull /data/app/ApiDemos/ApiDemos.apk /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/T/com.example.android.apis.apk'
    [debug] [UiAutomator2] Deleting UiAutomator2 session
    [debug] [UiAutomator2] Deleting UiAutomator2 server session
    [debug] [JSONWP Proxy] Matched '/' to command name 'deleteSession'
    [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.example.android.apis'
    [debug] [Logcat] Stopping logcat capture
    [debug] [ADB] Removing forwarded port socket connection: 8200
    [debug] [ADB] Running '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 forward --remove tcp\:8200'
    [debug] [BaseDriver] Event 'newSessionStarted' logged at 1548926370387 (17:19:30 GMT+0800 (GMT+08:00))
    [debug] [W3C] Encountered internal error running command: Error: Error executing adbExec. Original error: 'Command '/Users/zhangc/Desktop/mine/install/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 pull /data/app/ApiDemos/ApiDemos.apk /var/folders/gf/jjhn56c97293xtjvtwlnwr8h0000gp/T/com.example.android.apis.apk' exited with code 1'; Stderr: ''; Code: '1'
    [debug] [W3C]     at ADB.execFunc$ (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:327:13)
    [debug] [W3C]     at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    [debug] [W3C]     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    [debug] [W3C]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    [debug] [W3C]     at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    [HTTP] <-- POST /wd/hub/session 500 4214 ms -
    

    大神我报的这个错误,一直没找到解决办法

  • 2018 年 想说的话 at 2018年11月23日

    其实有时我也很迷茫的,只是个小白,感觉自己懂的挺少的,有点赶不上趟儿的感觉,只能逼一下自己😊 。兄弟才不是 “咸鱼” ,不管是工作还是做其他的,要找到自己的兴趣点并做下去。💪

  • 2018 年 想说的话 at 2018年11月23日

    哈,虽然正好相反,既然都是转型,兄弟你认准了这条道路就坚持下去,看好你,为了自己,加油!👍

  • 2018 年 想说的话 at 2018年11月23日

    谢谢,我会再好好想想的,您说的有些机制有的还不甚了解过,不过我会再结合实际再具体制定一下计划,真是感谢提的建议。😊

  • 2018 年 想说的话 at 2018年11月23日

    加油!⛽️

  • 2018 年 想说的话 at 2018年11月23日

    您说的是,虽然有时迷茫但是如果找到了一个大的方向,并加以坚持下去。👍

  • 2018 年 想说的话 at 2018年11月23日

    😬

  • 2018 年 想说的话 at 2018年11月23日

    哈哈,还谈不上,😝 逼一下自己。

  • 2018 年 想说的话 at 2018年11月23日

    哈哈,先撸为敬。

  • 2018 年 想说的话 at 2018年11月23日

    谢谢,根据您所说的,具体的计划暂时先排了一下版。😊

  • 2018 年 想说的话 at 2018年11月21日

    谢谢☺ 。这一年多学习的东西有点杂,也都是比较偏基础的用于工作的学习,希望之后能更系统的或借鉴社区的知识来学习。

  • 2018 年 想说的话 at 2018年11月21日

    😁

  • 2018 年 想说的话 at 2018年11月21日

    😊