Appium [已解决]运行时报 Error: socket hang up

学飞 · 2014年01月15日 · 最后由 Evan 回复于 2014年02月11日 · 3692 次阅读

我在执行到 driver = new SwipeableWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);这个步的时候 appium 报错
Error: socket hang up
at createHangUpError (http.js:1472:15)
at Socket.socketOnEnd as onend
at Socket.g (events.js:180:16)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
用 adb logcat |grep System 后看到以下 log,应用界面是打开了,搜索了半天没有找到解决方案,大神们帮忙分析下是吗原因
D/SystemBroadcastService(19117): Received broadcast action=android.intent.action.PACKAGE_ADDED and uri=
I/System.out(20592): Instrumentation initialized with main activity: com.snda.tt.ui.WelcomeActivity
W/System.err(20592): java.io.FileNotFoundException: /data/data/com.snda.tt/files/tips_info: open failed: ENOENT (No such file or directory)
W/System.err(20592): at libcore.io.IoBridge.open(IoBridge.java:416)
W/System.err(20592): at java.io.FileInputStream.(FileInputStream.java:78)
W/System.err(20592): at android.app.ContextImpl.openFileInput(ContextImpl.java:672)
W/System.err(20592): at android.content.ContextWrapper.openFileInput(ContextWrapper.java:159)
W/System.err(20592): at com.snda.tt.util.ab.h(Unknown Source)
W/System.err(20592): at com.snda.tt.newmessage.c.n.a(Unknown Source)
W/System.err(20592): at com.snda.tt.TTApp.onCreate(Unknown Source)
W/System.err(20592): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
W/System.err(20592): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4286)
W/System.err(20592): at android.app.ActivityThread.access$1300(ActivityThread.java:136)
W/System.err(20592): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
W/System.err(20592): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(20592): at android.os.Looper.loop(Looper.java:137)
W/System.err(20592): at android.app.ActivityThread.main(ActivityThread.java:4881)
W/System.err(20592): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(20592): at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(20592): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:804)
W/System.err(20592): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:571)
W/System.err(20592): at dalvik.system.NativeStart.main(Native Method)
W/System.err(20592): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
W/System.err(20592): at libcore.io.Posix.open(Native Method)
W/System.err(20592): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
W/System.err(20592): at libcore.io.IoBridge.open(IoBridge.java:400)
W/System.err(20592): ... 18 more
I/System.out(20592): Selendroid started on port 8080
I/System.out(20592): Started selendroid http server on port 8080
I/System.out(20592): new session command
W/System.err(20592): java.io.FileNotFoundException: /data/data/com.snda.tt/files/NetWorkConfig: open failed: ENOENT (No such file or directory)
W/System.err(20592): at libcore.io.IoBridge.open(IoBridge.java:416)
W/System.err(20592): at java.io.FileInputStream.(FileInputStream.java:78)
W/System.err(20592): at android.app.ContextImpl.openFileInput(ContextImpl.java:672)
W/System.err(20592): at android.content.ContextWrapper.openFileInput(ContextWrapper.java:159)
W/System.err(20592): at com.snda.tt.dataprovider.bk.a(Unknown Source)
W/System.err(20592): at com.snda.tt.dataprovider.bk.b(Unknown Source)
W/System.err(20592): at com.snda.tt.TTApp.onCreate(Unknown Source)
W/System.err(20592): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
W/System.err(20592): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4286)
W/System.err(20592): at android.app.ActivityThread.access$1300(ActivityThread.java:136)
W/System.err(20592): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
W/System.err(20592): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(20592): at android.os.Looper.loop(Looper.java:137)
W/System.err(20592): at android.app.ActivityThread.main(ActivityThread.java:4881)
W/System.err(20592): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(20592): at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err(20592): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:804)
W/System.err(20592): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:571)
W/System.err(20592): at dalvik.system.NativeStart.main(Native Method)
W/System.err(20592): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
W/System.err(20592): at libcore.io.Posix.open(Native Method)
W/System.err(20592): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
W/System.err(20592): at libcore.io.IoBridge.open(IoBridge.java:400)
W/System.err(20592): ... 18 more
W/System.err(20592): org.json.JSONException: End of input at character 0 of
W/System.err(20592): at org.json.JSONTokener.syntaxError(JSONTokener.java:450)
W/System.err(20592): at org.json.JSONTokener.nextValue(JSONTokener.java:97)
W/System.err(20592): at org.json.JSONObject.(JSONObject.java:154)
W/System.err(20592): at org.json.JSONObject.(JSONObject.java:171)
W/System.err(20592): at com.snda.tt.newmessage.c.aw.g(Unknown Source)
W/System.err(20592): at com.snda.tt.newmessage.c.bi.f(Unknown Source)
W/System.err(20592): at com.snda.tt.newmessage.c.bi.e(Unknown Source)
W/System.err(20592): at com.snda.tt.newmessage.c.bi.d(Unknown Source)
W/System.err(20592): at com.snda.tt.newmessage.c.bj.run(Unknown Source)
D/SystemBroadcastService(19117): Received broadcast action=android.intent.action.PACKAGE_CHANGED and uri=
W/System.err( 793): java.lang.IllegalArgumentException: Unknown package: com.google.android.apps.maps
W/System.err( 793): at com.android.server.pm.Settings.getApplicationEnabledSettingLPr(Settings.java:2323)
W/System.err( 793): at com.android.server.pm.PackageManagerService.getApplicationEnabledSetting(PackageManagerService.java:8683)
W/System.err( 793): at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:929)
W/System.err( 793): at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:1574)
W/System.err( 793): at android.os.Binder.execTransact(Binder.java:367)
W/System.err( 793): at dalvik.system.NativeStart.run(Native Method)
W/System.err( 793): java.lang.IllegalArgumentException: Unknown package: com.google.android.apps.maps
W/System.err( 793): at com.android.server.pm.Settings.getApplicationEnabledSettingLPr(Settings.java:2323)
W/System.err( 793): at com.android.server.pm.PackageManagerService.getApplicationEnabledSetting(PackageManagerService.java:8683)
W/System.err( 793): at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:929)
W/System.err( 793): at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:1574)
W/System.err( 793): at android.os.Binder.execTransact(Binder.java:367)
W/System.err( 793): at com.android.server.SystemServer.init1(Native Method)
W/System.err( 793): at com.android.server.SystemServer.main(SystemServer.java:983)
W/System.err( 793): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 793): at java.lang.reflect.Method.invoke(Method.java:511)
W/System.err( 793): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:804)
W/System.err( 793): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:571)
W/System.err( 793): at dalvik.system.NativeStart.main(Native Method)
===================================
更新到 0.14.2 版本没有此问题了,其中还有用 re-sign.jar 获取到的 Activity 不对,哎~~~

共收到 0 条回复 时间 点赞
1楼 已删除
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册