this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove examples directory to avoid issues with cloned repositories

- Remove examples/stream-video-bgra-example.sh
- Remove examples/stream-video-example.sh
- Remove examples/video-recording-alternative.sh
- Examples are now included in the command documentation instead
- Addresses issue with creating files in cloned repositories

Pedro 0067cce2 7846608c

-169
-65
examples/stream-video-bgra-example.sh
··· 1 - #!/bin/bash 2 - 3 - # Example: Working video streaming from iOS Simulator using BGRA format 4 - # This demonstrates how to use the stream-video command with raw BGRA output 5 - 6 - # Get simulator UDID (use first booted iPhone) 7 - UDID=$(xcrun simctl list devices | grep "iPhone.*Booted" | head -1 | grep -o "[A-F0-9-]\{36\}") 8 - 9 - if [ -z "$UDID" ]; then 10 - echo "No booted iPhone simulator found. Please boot a simulator first." 11 - exit 1 12 - fi 13 - 14 - echo "Using simulator: $UDID" 15 - 16 - # Get simulator dimensions (common iPhone sizes) 17 - # You may need to adjust these based on your simulator model 18 - WIDTH=393 # iPhone 15 Pro width 19 - HEIGHT=852 # iPhone 15 Pro height 20 - 21 - echo "Assuming dimensions: ${WIDTH}x${HEIGHT}" 22 - 23 - # Example 1: Stream BGRA to a raw file 24 - echo "" 25 - echo "Example 1: Streaming raw BGRA video to file..." 26 - echo "Press Ctrl+C to stop recording" 27 - swift run axe stream-video --udid "$UDID" --format bgra --fps 10 > raw-video.bgra 28 - 29 - echo "Raw video saved to: raw-video.bgra" 30 - echo "File size: $(ls -lh raw-video.bgra | awk '{print $5}')" 31 - 32 - # Example 2: Stream and convert to MP4 in real-time (requires ffmpeg) 33 - if command -v ffmpeg &> /dev/null; then 34 - echo "" 35 - echo "Example 2: Streaming and converting to MP4 in real-time..." 36 - echo "Press Ctrl+C to stop recording" 37 - 38 - swift run axe stream-video --udid "$UDID" --format bgra --fps 10 | \ 39 - ffmpeg -f rawvideo -pixel_format bgra -video_size ${WIDTH}x${HEIGHT} -framerate 10 -i - \ 40 - -c:v libx264 -pix_fmt yuv420p -preset fast \ 41 - -y realtime-capture.mp4 42 - 43 - echo "Video saved to: realtime-capture.mp4" 44 - else 45 - echo "" 46 - echo "FFmpeg not installed. To convert BGRA to MP4:" 47 - echo "brew install ffmpeg" 48 - echo "Then run:" 49 - echo "ffmpeg -f rawvideo -pixel_format bgra -video_size ${WIDTH}x${HEIGHT} -i raw-video.bgra -c:v libx264 -pix_fmt yuv420p output.mp4" 50 - fi 51 - 52 - # Example 3: Extract frames from raw BGRA 53 - echo "" 54 - echo "Example 3: Extracting first frame as PNG..." 55 - if command -v ffmpeg &> /dev/null && [ -f raw-video.bgra ]; then 56 - BYTES_PER_FRAME=$((WIDTH * HEIGHT * 4)) 57 - dd if=raw-video.bgra of=first-frame.raw bs=$BYTES_PER_FRAME count=1 2>/dev/null 58 - ffmpeg -f rawvideo -pixel_format bgra -video_size ${WIDTH}x${HEIGHT} -i first-frame.raw -frames:v 1 first-frame.png -y 2>/dev/null 59 - rm -f first-frame.raw 60 - echo "First frame saved to: first-frame.png" 61 - fi 62 - 63 - echo "" 64 - echo "Note: H264 and MJPEG formats are currently not working due to FBSimulatorControl issues." 65 - echo "Use BGRA format for raw pixel data or 'xcrun simctl io recordVideo' for compressed video."
-61
examples/stream-video-example.sh
··· 1 - #!/bin/bash 2 - 3 - # Example script demonstrating video streaming with AXe 4 - # NOTE: Currently only BGRA format works properly. H264/MJPEG formats have known issues. 5 - 6 - # Get simulator UDID (use first booted iPhone) 7 - UDID=$(xcrun simctl list devices | grep "iPhone.*Booted" | head -1 | grep -o "[A-F0-9-]\{36\}") 8 - 9 - if [ -z "$UDID" ]; then 10 - echo "No booted iPhone simulator found. Please boot a simulator first." 11 - exit 1 12 - fi 13 - 14 - echo "Using simulator: $UDID" 15 - 16 - # Example 1: Stream BGRA video to file (currently the only working format) 17 - echo "Example 1: Streaming BGRA video to file for 5 seconds..." 18 - echo "Note: BGRA outputs raw pixel data (4 bytes per pixel)" 19 - swift run axe stream-video --udid "$UDID" --format bgra --fps 30 > recording.bgra & 20 - PID=$! 21 - sleep 5 22 - kill -INT $PID 23 - wait $PID 2>/dev/null 24 - echo "Video saved to recording.bgra" 25 - echo "To convert to MP4: ffmpeg -f rawvideo -pixel_format bgra -video_size 393x852 -i recording.bgra output.mp4" 26 - echo "" 27 - 28 - # Example 2: Show H264 format warning (currently not working) 29 - echo "Example 2: H264 format (WARNING: Currently not functional)" 30 - echo "Note: H264 encoding is broken in FBSimulatorControl. This will show warnings." 31 - swift run axe stream-video --udid "$UDID" --format h264 --fps 30 > test-h264.h264 & 32 - PID=$! 33 - sleep 2 34 - kill -INT $PID 35 - wait $PID 2>/dev/null 36 - echo "H264 test complete (expected to produce no data)" 37 - rm -f test-h264.h264 38 - 39 - # Example 3: Real-time BGRA to MP4 conversion with FFmpeg 40 - echo "" 41 - if command -v ffmpeg &> /dev/null; then 42 - echo "Example 3: Streaming BGRA and converting to MP4 in real-time..." 43 - swift run axe stream-video --udid "$UDID" --format bgra --fps 10 | \ 44 - ffmpeg -f rawvideo -pixel_format bgra -video_size 393x852 -framerate 10 -i - \ 45 - -c:v libx264 -pix_fmt yuv420p -preset fast \ 46 - -y realtime.mp4 & 47 - PID=$! 48 - sleep 5 49 - kill -INT $PID 50 - wait $PID 2>/dev/null 51 - echo "Real-time video saved to realtime.mp4" 52 - else 53 - echo "Example 3: ffmpeg not found. Install it with: brew install ffmpeg" 54 - echo "Skipping real-time MP4 conversion example." 55 - fi 56 - 57 - # Cleanup 58 - rm -f recording.bgra 59 - 60 - echo "" 61 - echo "Video streaming examples completed!"
-43
examples/video-recording-alternative.sh
··· 1 - #!/bin/bash 2 - 3 - # Alternative video recording script for iOS Simulator 4 - # Since streaming to stdout is no longer supported by Apple and FBSimulatorControl has issues 5 - 6 - # Get simulator UDID (use first booted iPhone) 7 - UDID=$(xcrun simctl list devices | grep "iPhone.*Booted" | head -1 | grep -o "[A-F0-9-]\{36\}") 8 - 9 - if [ -z "$UDID" ]; then 10 - echo "No booted iPhone simulator found. Please boot a simulator first." 11 - exit 1 12 - fi 13 - 14 - echo "Using simulator: $UDID" 15 - 16 - # Method 1: Record to file using xcrun simctl 17 - echo "Method 1: Recording video to file using xcrun simctl..." 18 - echo "Press Ctrl+C to stop recording" 19 - OUTPUT_FILE="simulator-recording-$(date +%Y%m%d-%H%M%S).mp4" 20 - xcrun simctl io "$UDID" recordVideo --codec=h264 "$OUTPUT_FILE" 21 - echo "Video saved to: $OUTPUT_FILE" 22 - 23 - # Method 2: Use AXe stream-video (may not produce output due to known issues) 24 - echo "" 25 - echo "Method 2: Attempting to stream using AXe (may not work due to FBSimulatorControl issues)..." 26 - echo "Press Ctrl+C to stop if it hangs" 27 - timeout 10 swift run axe stream-video --udid "$UDID" --format mjpeg > test-stream.mjpeg 2>&1 || true 28 - 29 - if [ -s test-stream.mjpeg ]; then 30 - echo "Stream data saved to test-stream.mjpeg" 31 - else 32 - echo "No stream data produced (expected due to known issues)" 33 - rm -f test-stream.mjpeg 34 - fi 35 - 36 - # Method 3: Screen recording recommendation 37 - echo "" 38 - echo "Method 3: For live streaming, consider using:" 39 - echo "- OBS Studio (https://obsproject.com/) - Free and open source" 40 - echo "- QuickTime Player - Built-in screen recording" 41 - echo "- ScreenFlow or similar commercial tools" 42 - echo "" 43 - echo "These tools can capture the simulator window and stream/record as needed."