Archive for the ‘MacOS’ Category

วิธีการใช้งาน scrcpy เพื่อ mirror หน้าจอ samsung s24 บนเครื่อง mac

#ที่มือถือให้ทำการเปิด Developer Mode

1. ไปที่ settings > About phone > Software information >

กดย้ำๆที่ Build number 7 ครั้ง มือถือจะแจ้งว่า Developer mode On

2. เลือก Settings > Security and privacy. กด ปิด Auto Blocker

3. ที่เครื่องมือถือจะมีป๊อปอัพเตือนว่ามีการเสียบสาย USB เข้ากับเครื่อง MAC. ให้เลือกใช้งานตามจุดประสงค์

4. ให้ทำการติดตั้งโปรแกรม scrcpy โดยจะติดตั้งผ่าน homebrew.

ถ้ายังไม่เคยติดตั้งใช้งาน homebrew ให้ไปติดตั้ง homebrew ก่อน

ติดตั้ง Homebrew บน Mac (ถ้ายังไม่มี)

# /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

5. จากนั้นติดตั้ง ADB และ scrcpy ผ่าน Homebrew

brew install android-platform-tools # สำหรับ ADB
brew install scrcpy # ติดตั้ง scrcpy

6.เชื่อมต่อ S24 เข้ากับ Mac ผ่าน USB-C Cable

•ใช้สายแท้ หรือสายที่รองรับ Data Transfer

•หลังเสียบ → บนมือถือจะขึ้น “Allow USB Debugging?”กด Allow

7.ตรวจสอบว่า Mac เจอ S24 หรือไม่

พิมพ์ใน Terminal:

adb devices

ถ้าเจออุปกรณ์มือถือจะแจ้งว่า

List of devices attached

xxxxxxxxxxxx device

8. รัน scrcpy

teee@NP Programs % scrcpy
scrcpy 3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: –> (usb) RFCxxxxxxxx device SM_S921B
/opt/homebrew/Cellar/scrcpy/3.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 106.3 MB/s (90640 bytes in 0.001s)
[server] INFO: Device: [samsung] samsung SM-XXXXX (Android 14)
INFO: Renderer: metal
INFO: Texture: 1080×2336
2025-03-17 15:31:22.355 scrcpy[37968:994087] +[IMKClient subclass]: chose IMKClient_Modern
2025-03-17 15:31:22.355 scrcpy[37968:994087] +[IMKInputSession subclass]: chose IMKInputSession_Modern

 

 

 

 

ในการรัน TFTP server บนเครื่อง Mac

คุณสามารถทำตามขั้นตอนด้านล่างนี้:

1. เปิด Terminal: ไปที่ Applications >  Terminal

2. ตรวจสอบสถานะ: คุณสามารถตรวจสอบว่า TFTP daemon กำลังทำงานอยู่หรือไม่ โดยใช้คำสั่ง:

% sudo launchctl list | grep tftp

หรือใช้คำสั่ง

%sudo lsof -i :69

หรือคำสั่ง

%netstat -atp UDP | grep tftp

หรือลอง ทดสอบเชื่อม localhost

%tftp localhost

ถ้าเข้าสู่ prompt ของ tftp ได้ (เช่น tftp>) หมายความว่า TFTP server ของคุณทำงานอยู่

3.เช็คว่า tftpd มีอยู่ในเครื่อง

% cat /System/Library/LaunchDaemons/tftp.plist

4.เพื่อความง่ายในการหา Folder จะทำการเปลี่ยนแปลงนิดหน่อย

% cd /private

% sudo rm -rf tftpboot

% mkdir /Users/(YourUser)/tftpboot

% sudo ln -s /Users/(YourUser)/tftpboot tftpboot

ให้ทำการ Start tftp ด้วยคำสั่ง

% sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist

ถ้าต้องการ Stop process ให้ใช้คำสั่ง

% sudo launchctl unload /System/Library/LaunchDaemons/tftp.plist