IT관련
안드로이드 앱피움 가이드 (Appium Guide for Android)
악마성
2022. 2. 21. 13:15
728x90
반응형
Android Appium 실행 순서 정리
미리 모든 환경이 설정되어있다는 가정하에 작성을 하고 있습니다.
Appium Server 실행
Android AVD 실행
저는 터미널 명령어로 실행을 하는 방법으로 진행을 했습니다.
emulator -list-avds
# 검색 결과 나온 이름 저장
emulator -avd <name>
만약 zsh: command not found emulator 라고 발생이 된다면 Android_Home 이나 Java_Home 환경 설정이 제대로 되어있지 않아서 일겁니다.
만약 bash_profile 에는 제대로 저장이 되어있는데도 똑같이 위와 같이 command not found 라면
sudo vim ~/.zshrc
# 스크롤 내려서 제일 아래
# bash_profile 에 저장했던 android_home 및 java_home 관련 내용 저장 후 붙혀넣기
source ~/.zshrc
Appium Inspector 실행
Android 같은 경우는 아래 형식과 같이 Capabilities 를 입력합니다.
{
"platformName": "Android",
"appium:platformVersion": "11.0",
"appium:deviceName": "Android Emulator",
"appium:app": "/Users/sunbae/27419559.apk",
"appium:automationName": "Appium",
"appium:noReset": true,
"appium:newCommandTimeout": "7200",
"appium:appPackage": "co.example.staging",
"appium:appActivity": "co.example.splash.SplashActivity"
}
Capabilities 항목 중에 와 appActivity 를 확인하는 방법 입니다.
- Android Device or Android Emulator 가 연결되어 있는 경우
adb shell
logcat | grep <package name>
위 명령어를 입력 후 나의 앱을 실행 합니다.
그 후 MAIN 이라고 검색을 한 후 해당 라인에 cmp 라는 Value에 있는 activity가 시작 Activity 입니다.
- 이 중에서 좀 더 자세히 activity 를 알 수 있는 방법
adb shell pm dump co.test.staging | grep -A 1 MAIN
728x90
반응형