Appium 【已解决】运行测试代码报错 A new session could not be created. Original error: Could not find zipalign

tom_ma · 2014年05月01日 · 最后由 迷惘的一代 回复于 2014年05月20日 · 1287 次阅读

环境:
windows 7

AppiumForWindows-0.18.0
selenium-java-2.41.0 junit3
sdk api level 19
安卓虚拟机 nexus5

确认环境配置已 ok。

执行步骤:
运行测试代码,采用 junit test 报错:
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not find zipalign; do you have the Android SDK installed and the tools + platform-tools folders added to your PATH?) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15.50 seconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15'
System info: host: 'xx', ip: 'xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51'
Driver info: com.incito.appiumdemo.ContactManagerTest$SwipeableWebDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)

共收到 3 条回复 时间 点赞


上传下报错的截图,方便大家帮忙定位。

问题已解决,大致是因为安装测试应用到虚拟机时,需要先重签名测试应用,而此时找不到 zipalign 造成的。将 zipalign 所在路径加入到系统 path 变量里,重启 eclipse 和 appuim 重新运行即可解决。

#2 楼 @tom_ma appium 测试 APK 需要重签名?

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册