WebDriverAgent 설치

garaming·2023년 11월 2일
0

automation

목록 보기
2/6

WebDriverAgent 설치

WebDriverAgent 설치하기 전에 체크 리스트

  • Xcode 설치 -> App store에서 설치 가능함
  • Apple 개발자 ID 생성 -> 개발자 ID를 회사에서 등록해주는 절차가 필요함
  • Carthage 라이브러리 설치

1. WebDriverAgent Project Git Clone

1) Appium/WebDriverAgent Github에서 Git Clone

2) Xcode 실행 > Clone and existing project

3) Github에서 복사한 URL 입력 > Clone > master 브랜치 선택 > 이후 디렉토리 선택(Document로 지정함)

+) bootstrap 명령어 수행

  • Terminal에서 /Users/본인 PC명/Documents/WebDriverAgent 경로로 이동 후
  • ./Scripts/bootstrap.sh -d 명령어 실행
    ⚠️ 위 명령어를 수행하는데 Scripts 폴더 안 bootstrap.sh가 없어 실행하지 못한다는 에러가 발생했다. 해결 방법은 찾지 못함.

2. Xcode에 개발자 ID 등록하기

Apple 개발자 사이트에서 등록된 ID를 입력해야 함

  • Xcode 설정 > Account > + 버튼 > Apple ID > Continue > 로그인

이때 등록한 나의 ID말고 회사명도 같이 표시가 되어 있어야 함. 그렇지 않으면 등록되지 않은 것.
정상적으로 회사명이 표시되면 Download Manual Profile 버튼을 눌러서 권한을 내려받아야 함⭐️⭐️⭐️

3. Signing and Bundle indentifier 수정

  • WebDriverAgent > Target > WebDriverAgentRunner > Signing & Capabilities > Team에서 등록한 개발자 ID 선택

이때 경고 표시가 나타나는데 Bundle identifier 값이 이미 등록되어있기 때문. 따라서 해당 값을 Unique 값으로 바꿔준다.
ex) com.facebook.WebDriverAgentRunner ▶️ com.ari.WebDriverAgentRunner


이후 위에 있는 탭들도 전부 바꿔준다.
⭐️⭐️⭐️ Integration App > 위에 적은 임의의 문자만 바꿔주면 됨. (위에서 적은 임의의 문자랑 다른걸 적어야함)

4. 기기에 연결

맥과 해당 기기를 연결하면 위와 같이 연결된 기기가 뜬다. 해당 기기를 선택한 후 좌측 상단의 ▶️ 버튼을 선택해 빌드를 진행한다.

이후로는 다시 terminal에서 /Users/본인 PC명/Documents/WebDriverAgent 경로로 가서 아래 명령어를 실행한다.

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination “id=기기 ID값” test

-> 이때 기기 ID 값은 Apple Configurator에서 UDID 값을 볼 수 있다.

4-1. Xcode Command line tools 에러

Xcode 빌드 진행 중 아래 에러가 발생함

tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

구글 검색 시 Xcode를 커맨드로 빌드하는 과정에서 Command line tools를 사용하지 못한다는 에러. 터미널에서 권한을 줘야 함.

본인 PC의 Xcode 경로에 따라서 아래 명령어 수행

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer


참고 블로그

4-2. 큰 따옴표 에러..

위 문제를 해결하고 다시 빌드 시도 중 아래 에러 발생..

error: option 'Destination' requires at least one parameter of the form 'key=value'

Destination의 문제인 것 같은데 바로 "id=기기 ID값" 에서 이 ""가 문제였던 것.. (알려주신 Thanks to 칼리님..🥹)

"" ▶️ '' 로 수정

4-3. 버전 에러

error: Failed to build project WebDriverAgent with scheme WebDriverAgentRunner.: Cannot test target “WebDriverAgentRunner” on “My Mac”: My Mac’s macOS 13.6.1 doesn’t match WebDriverAgentRunner’s macOS 14.0 deployment target.

나의 맥과 Xcode 버전 호환이 안되는 것으로 추측..

4-4 Xcode couldn't find any iOS APP Development provisioning profiles matching "..."

No profiles for 'com.ari.WebDriverAgentRunner.xctrunner' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.ari.WebDriverAgentRunner.xctrunner'.

클론했던 📁 WebDriverAgent 폴더 삭제 후 다시 클론 > 개발자 ID 등록 > 권한 내려받기 > Signing and Bundle indentifier 수정해서 해결

이때 수정한 항목

  • WebDriverAgentLib
  • WebDriverAgentRunner
  • ItergrationApp

일괄 com.facebook.WebDriverAgent -> com.uniqueID.WebDriverAgent 로 수정함


+역시 잘 안되면 껐다 키는게 쵝오.......

다른 Error들..

1) command not found

기본 세팅을 아래 방식으로 시작했다.
(1) homebrew 설치 > (2) node 홈페이지에서 설치 > (3) npm install appium

이때 (2) 과정에서 경로를 지정해주는 node 관련 명령어를 실행하였고, 그것이 homebrew 경로와 꼬여서 appium을 설치했음에도 appium --version 을 실행하면 command not found 명령어만 우후죽순..


따라서 맥을 초기화하기로 결정했다...🥲 마음이 아팠지만 그래도 다시 처음부터 시작하는게 나을것 같단 생각이 들었다..
아래는 다시 진행한 세팅 순서

(1) hombrew 설치 - 이때 echo로 시작하는 명령어가 중요하다⭐️⭐️⭐️ 빼먹지 않고 실행하기..
🔽
(2) hombrew로 node 설치하기
🔽
(3) npm install appium

이렇게 하면 appium --version 시 정상적으로 버전이 출력된다!

profile
Connecting the dots

0개의 댓글