同步到设备后,tns测试android会挂起

时间:2019-01-09 10:34:20

标签: typescript mocha nativescript

我目前正在尝试在我的nativescript项目上设置单元测试。我将mocha和chai用作测试框架,并且一切正常运行tns test init

当我运行tns test android时,一切运行正常,模拟器启动。但是,在将应用程序同步到我的模拟器(也可以正常启动)之后,它挂在:

JS: NSUTR: fetching http://***.***.**.*:9876/context.json
JS: NSUTR: fetching http://***.***.*.**:9876/context.json
JS: NSUTR: fetching http://127.0.0.1:9876/context.json

在运行tns test android --debug-brk时,我尝试了一些其他操作,以查看失败之处。这表示Error: Could not find device by specified identifier 'undefined',但是仿真器运行良好,因为命令已将其启动,因此我可以使用tns device看到仿真器。

非常感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

android:usesCleartextTraffic="true"Android Manifest文件中添加<application似乎已经解决了找不到Karma服务器的问题。

请参见https://github.com/NativeScript/nativescript-cli/issues/4182

我正在使用本机脚本版本4.2.0,因此最新版本可能已解决此问题。

相关问题