This project enables mirroring of Android and iPhone screens to a Tesla browser. It consists of four main components:
- Open the project in Android Studio.
- Ensure you have the latest Android SDK installed.
- Connect your Android device or use an emulator.
- Build and run the app on your device/emulator.
- Open
ScreenMirrorActivity.kt
. - Replace
"ws://your-server-url:3001"
with your actual WebSocket server URL. - Update the
JWT_SECRET
in the app to match your server's secret.
- Launch the app on your Android device.
- Tap "Start Mirroring" to begin screen mirroring.
- Tap "Stop Mirroring" to end the session.
- Open the project in Xcode.
- Ensure you have the latest Xcode version and iOS SDK installed.
- Connect your iPhone device (required for screen recording capabilities).
- Build and run the app on your device.
- Open
ScreenMirrorViewController.swift
. - Replace
"ws://your-server-url:3001"
with your actual WebSocket server URL. - Update the
Info.plist
file with necessary permissions:
NSCameraUsageDescription
This app needs camera access to record the screen.
NSMicrophoneUsageDescription
This app needs microphone access to record the screen.
- Launch the app on your iPhone.
- Tap "Start Mirroring" to begin screen mirroring.
- Tap "Stop Mirroring" to end the session.
- Ensure you have Node.js and npm installed.
- Navigate to the server directory.
- Run
npm install
to install dependencies.
- Create a
.env
file in the server directory with the following content:
JWT_SECRET=your_secret_key
DATABASE_URL=your_database_connection_string
PORT=3001
- Replace
your_secret_key
with a secure random string. - Replace
your_database_connection_string
with your PostgreSQL database URL.
- Run
npm start
to start the server. - The server will be available at
http://localhost:3001
(or the port you specified).
- Ensure you have Node.js and npm installed.
- Navigate to the web frontend directory.
- Run
npm install
to install dependencies.
- Open
PhoneMirror.js
. - Replace
"ws://your-server-url:3001"
with your actual WebSocket server URL.
- Run
npm start
to start the development server. - Access the web app through the Tesla browser at the provided URL.
- Ensure all components are on the same network or that the server is accessible to both the mobile apps and the Tesla browser.
- The JWT secret must be the same across the server and mobile apps for authentication to work correctly.
- For production use, implement proper error handling, reconnection logic, and security measures.
- Remember to comply with all relevant laws and regulations regarding screen recording and data transmission.
- If the connection fails, check that the WebSocket URL is correct and that the server is running.
- For iPhone app issues, ensure you're testing on a physical device, not the simulator.
- If authentication fails, verify that the JWT secret is consistent across all components.
- Use HTTPS for the web frontend and WSS (WebSocket Secure) for real-time communications.
- Regularly update the JWT secret and implement token refresh mechanisms.
- Implement rate limiting and other anti-abuse measures on the server.
For any additional help or feature requests, please open an issue in the project repository.