def start_phonesim(self): phonesim_bin = os.path.join(self.sdk_path, 'Pebble', 'common', 'phonesim', 'phonesim.py') layout_file = os.path.join(self.sdk_path, 'Pebble', self.platform, 'qemu', "layouts.json") if not os.path.exists(phonesim_bin): logging.debug("phone simulator not found: {}".format(phonesim_bin)) raise Exception("Your SDK does not support the Pebble Emulator") cmdline = [phonesim_bin] cmdline.extend(["--qemu", "localhost:{}".format(QEMU_DEFAULT_BT_PORT)]) cmdline.extend(["--port", str(PHONESIM_PORT)]) cmdline.extend([ "--persist", os.path.join(self.persistent_dir, self.platform, pebble.get_sdk_version()) ]) cmdline.extend(["--layout", layout_file]) if self.debug_phonesim: cmdline.extend(['--debug']) if self.oauth_token: cmdline.extend(["--oauth", self.oauth_token]) if self.debug: process = subprocess.Popen(cmdline) else: process = subprocess.Popen(cmdline, stdout=FNULL, stderr=FNULL) # Save the PID with open(self.phonesim_pid, 'w') as pf: pf.write(str(process.pid))
def _get_spi_path(self, platform=None): if platform is None: platform = self.platform return os.path.join(self.persistent_dir, platform, pebble.get_sdk_version(), 'qemu', "qemu_spi_flash.bin")
def start_phonesim(self): phonesim_bin = os.path.join(self.sdk_path, 'Pebble', 'common', 'phonesim', 'phonesim.py') layout_file = os.path.join(self.sdk_path, 'Pebble', self.platform, 'qemu', "layouts.json") if not os.path.exists(phonesim_bin): logging.debug("phone simulator not found: {}".format(phonesim_bin)) raise Exception("Your SDK does not support the Pebble Emulator") cmdline = [phonesim_bin] cmdline.extend(["--qemu", "localhost:{}".format(QEMU_DEFAULT_BT_PORT)]) cmdline.extend(["--port", str(PHONESIM_PORT)]) cmdline.extend(["--persist", os.path.join(self.persistent_dir, self.platform, pebble.get_sdk_version())]) cmdline.extend(["--layout", layout_file]) if self.debug_phonesim: cmdline.extend(['--debug']) if self.oauth_token: cmdline.extend(["--oauth", self.oauth_token]) if self.debug: process = subprocess.Popen(cmdline) else: process = subprocess.Popen(cmdline, stdout=FNULL, stderr=FNULL) # Save the PID with open(self.phonesim_pid, 'w') as pf: pf.write(str(process.pid))