Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Testing your chromecast receiver app, without a real-device needed.
| Date | Stars |
|---|---|
| 2026-07-24 | 297 |
| 2026-07-25 | 297 |
| 2026-07-28 | 297 |
| 2026-07-30 | 297 |
| 2026-08-06 | 297 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Chromecast Device Emulator
Testing your chromecast receiver app, without a real-device needed.
[](https://www.npmjs.com/package/chromecast-device-emulator)
[](https://travis-ci.org/ajhsu/chromecast-device-emulator)
[](https://github.com/prettier/prettier)
## TL;DR
**Chromecast Device Emulator** is a set of tools that enables you to develop, run, and test your chromecast receiver app right on your local machine.
## What is this?
So far the only way to test your receiver app is to run on a Google Cast device (e.g. Chromecast, Google Home). Also, you have to make sure that your app is public accessible via an HTTPS connection.
It turns out whenever you're try to test the receiver app, you have to deploy the application every single time; This kind of deploy-and-debug routine could be redundant and time-wasting.
The emulator is designed for letting developers getting away from this, by emulating a Google Cast right on your local machine.
## How it works?
Before getting started, we have to understand how the emulator works:
What a Google Cast device do, is providing a chromium browser with a socket server that handing over IPC messages between sender(s) and receiver.
So we can emulate the same context by creating a socket server in the background while we're developing receiver app on a local machine (e.g. your laptop).
<p align='left'>
<img src='https://unpkg.com/chromecast-device-emulator/diagram.svg' alt='Diagram of Emulator'>
</p>
## Usage
There're two types of usage:
1. CLI: Running the emulator as a CLI. Ideal for local development.
2. Node API: Install `chromecast-device-emulator` as your dependency. Ideal for integrating your test automation.
### 1. CLI
To run as a CLI, we can install executable npm package globally:
```bash
$ npm install chromecast-device-emulator -g
```
Startup the emulator with a [pre-recorded scenario JSON file](#what-is-a-pre-recorded-scenario-json-file)
```bash
$ chromecast-device-emulator start scenario.json
```
Or `cde` for short
```bash
$ cde start scenario.json
```
The emulator will up and serve at port 8008 for local development.
> Note that the emulator will establish a new connection for each receiver app so that you can test multiple receiver apps at the same time.
### 2. Node API
To use as a node package, you can install as your dependency:
```bash
npm install chromecast-device-emulator --save-dev
```
After that, we can import the package and create an emulator.
```javascript
var CastDeviceEmulator = require('chromecast-device-emulator');
// Create a new instance
var emulator = new CastDeviceEmulator();
```
Load and serve your [pre-recorded scenario JSON file](#what-is-a-pre-recorded-scenario-json-file)
```javascript
// Load pre-recorded scenario
emulator.loadScenario(require('./scenario.json'));
// Startup the emulator
emulator.start();
// Server is up for receiver app
// Do something...
// Stop the emulator
emulator.stop();
```
## What is a pre-recorded scenario JSON file?
What emulator did, is try to **REPLAY** the IPC messages between sender and receiver. Which means that you have to **PRE-RECORD** from a real Google Cast device to get these IPC messages.
*(See [The IPC Message Recorder](#record-your-scenario-with-ipc-message-recorder) chapter for details)*
From receiver app booted until it was closed; Each of IPC message between sender and receiver should be recorded into one single JSON file with timestamps.
By doing so, the emulator is able to **REPLAY** these message when we needed it. And we called it a "Scenario JSON file".
A simple scenario JSON will look like this:
```json
{
"timeline": [
{
"time": 5520,
"ipcMessage": "{\"data\":\"{\\\"type\\\":\\\"visibilitychanged\\\"}\",\"namespace\":Excerpt of 8,595 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:2404259a1f3c4e21, topic:testing