Appium [已解决] appium 配置 android-settings,加载新的 apk 包后,activity 在列表中不存在导致报错

sincool · 2015年06月30日 · 最后由 sincool 回复于 2015年06月30日 · 1348 次阅读

appium 测试换了一个新的 apk 包,activity 在列表中不存在

这个包我查找了它的 activity-name

在脚本中我也指定了
desired_caps['appPackage'] = 'com.juchaozhi'
desired_caps['appActivity'] = 'cn.juchaozhi.launcher.LauncherActity_'

运行,appium 中报错:
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity)","origValue":"Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity"},"sessionId":null}

找了一些资料,说是 appium 中不用设置,只是脚本中设置即可,但我这里测试的结果明显不行!

具体原因不知道为什么,只是第二天再打开 appium 就 OK 了。

共收到 5 条回复 时间 点赞

麻烦给出完整的 appium server log 。

你确定启动的 activity-name 正确吗?我有点怀疑。

是不是应用名称错了

@laiyuncong8404 确认,因为查找方式一样,用了别的 apk 包,就可以自动在 android-settings 中有 activity-name 出来。。。

@diao2007 换了其它应用的 apk 包,就是可以的,这个 apk 包打的时候不知道有什么问题,用命令行查找 activity-name 方法一样,都是 aapt dump badging xx.apk

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