无法运行pebble javascript模拟器(pypkjs)

时间:2015-10-10 20:10:19

标签: javascript python pebble-watch pebble-sdk pebble-js

我试图设置PebbleKit JS模拟器,以便能够在没有Pebble-Watch本身的情况下完全开发。我按照github repo的指示安装了模拟器,但是当他们在github上运行模拟器时,我遇到了错误,我无法弄清楚原因。我重新安装了几次,错误仍然存​​在。 (我安装了QEMU-Emulator并且工作正常)

似乎JS-Simulator无法连接到QEMU-Emulator。这是在没有打开QEMU的情况下运行./phonesim.py时的终端输出:

Namespace(debug=False, layout=None, oauth=None, pbws=[], persist=None, port=9000, qemu='127.0.0.1:12344', ssl_root=None, token=None)
['127.0.0.1', '12344']
INFO:pypkjs:Ready. Loaded apps:
Traceback (most recent call last):
  File "./phonesim.py", line 31, in <module>
    runner.run()
  File "/Users/manuelburger/pypkjs/runner/websocket.py", line 56, in run
    pebble_greenlet = self.pebble.connect()
  File "/Users/manuelburger/pypkjs/pebble_manager.py", line 29, in connect
    self.pebble.connect()
  File "/Library/Python/2.7/site-packages/libpebble2/communication/__init__.py", line 56, in connect
    self.transport.connect()
  File "/Library/Python/2.7/site-packages/libpebble2/communication/transports/qemu/__init__.py", line 53, in connect
    raise ConnectionError(str(e))
libpebble2.exceptions.ConnectionError: [Errno 61] Connection refused

这是运行./jskit.py localhost:12344 watchface1.pbw并运行了QEMU watchface1.pbw的输出:

['localhost', '12344']
Traceback (most recent call last):
  File "./jskit.py", line 28, in <module>
    runner = TerminalRunner(sys.argv[1], sys.argv[2:], "data")
  File "/Users/manuelburger/pypkjs/runner/terminal.py", line 15, in __init__
    super(TerminalRunner, self).__init__(*args, **kwargs)
  File "/Users/manuelburger/pypkjs/runner/__init__.py", line 37, in __init__
    self.timeline = PebbleTimeline(self, persist=persist_dir, oauth=oauth_token, layout_file=layout_file)
  File "/Users/manuelburger/pypkjs/timeline/__init__.py", line 33, in __init__
    model.prepare_db(self.persist_dir + '/timeline.db')
  File "/Users/manuelburger/pypkjs/timeline/model.py", line 312, in prepare_db
    db.connect()
  File "/Library/Python/2.7/site-packages/peewee.py", line 2811, in connect
    self.__local.closed = False
  File "/Library/Python/2.7/site-packages/peewee.py", line 2732, in __exit__
    reraise(new_type, new_type(*exc_value.args), traceback)
  File "/Library/Python/2.7/site-packages/peewee.py", line 2810, in connect
    **self.connect_kwargs)
  File "/Library/Python/2.7/site-packages/peewee.py", line 3016, in _connect
    conn = sqlite3.connect(database, **kwargs)
peewee.OperationalError: unable to open database file

非常感谢任何帮助和建议来解决这个问题。

1 个答案:

答案 0 :(得分:0)

我找到了几件事:

  1. 我的默认端口不是12344.运行&#39; ps -ax | grep qemu&#39;在它运行的同时你可以看到正在使用的端口。我通过&localhost:41968&#39;连接。这可能是获得qemu实际端口的更好方法,但这样做有效。

  2. 对于phonesim.py,您需要指定与qemu和端口的连接,您可以再次从上面ps命令的输出中复制。例如,在我的情况下,除非我将其作为&#39; ./ phonesim.py --qemu localhost:41968&#39;

  3. 运行,否则它将失败
  4. jskit未能尝试打开数据库&#39; data / timeline.db&#39;,因此您需要创建一个名为&#39; data&#39;的子目录。在您从中运行jskit的文件夹中。如果jskit为你创建了那个文件夹,那就不错了,但它似乎并没有。

  5. 希望有所帮助!