윈도우 VS Code에서 맥의 Objective-C 프로젝트를 편집하면서 자동완성까지 쓰는 방법
1️⃣ 준비물
- 맥에서
- Xcode 설치
- SSH 활성화:
- 시스템 설정 → 공유 → 원격 로그인 켜기
- 사용자 계정 확인 (맥 사용자이름)
- 윈도우에서
- VS Code 설치
- 확장 설치:
- Remote – SSH (by Microsoft)
- C/C++ (by Microsoft)
2️⃣ VS Code – Remote SSH 연결
- VS Code에서 Ctrl+Shift+P → Remote-SSH: Connect to Host... 선택
- 새 SSH 호스트 추가:
ssh 사용자이름@맥_IP주소
- 예: ssh tv@192.168.0.10
- 처음 연결 시 호스트 키 확인, 비밀번호 입력
- 연결되면 VS Code가 맥 환경을 그대로 불러옵니다.
- 파일 탐색기에서 맥의 소스 폴더 열기 가능
- .xcodeproj나 .m, .h 파일도 편집 가능
3️⃣ 자동완성 설정
- VS Code에서 C/C++ 확장 설치 확인
- .vscode/c_cpp_properties.json 파일 생성 (프로젝트 루트):
{ "configurations": [ { "name": "Mac Objective-C", "includePath": [ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", "${workspaceFolder}/**" ], "defines": [], "macFrameworkPath": [ "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" ], "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "macos-clang-x64" } ], "version": 4 }
⚠️ 경로는 맥의 실제 Xcode SDK 경로와 맞춰야 합니다.
/Applications/Xcode.app/... 기본 설치 경로 기준입니다.
4️⃣ 빌드와 테스트
- 편집은 윈도우에서 VS Code로 가능
- 빌드/실행은 맥 터미널에서:
cd /경로/프로젝트 xcodebuild -scheme YourScheme -workspace YourWorkspace.xcworkspace
- Remote-SSH를 사용하면 맥 터미널도 VS Code 안에서 바로 열 수 있음 (Ctrl+Shift+P → Remote-SSH: Open Terminal)
댓글