갤럭시기준으로 상단바를 하위로 내렸을 때 "화면 녹화" 기능이 있으면 오디오까지 같이 녹화 가능

* 이 기능은 갤럭시노트9의 안드로이드 버전 10부터 지원

* 갤럭시노트8까지는 상단바에서 "화면 녹화"기능을 지원하지 않음

 

갤럭시노트8에서 화면녹화 할려면 adb shell에서 screenrecord를 이용하면 가능함.

* 하지만 기기에서 audio 녹음까지 동시 지원하지 않아서 화면만 녹화가능함.

* 디바이스에서의 지원문제(?)로 scrcpy와 같은 응용프로그램으로도 안되는 듯

 

scrcpy에서의 화면녹화 시 audio 지원은 Android 11이상부터 지원한다고 소개되어 있음.

- https://github.com/Genymobile/scrcpy

 

소리관련

* 구글에서 Android 9 이하의 시스템은 내부사운드(시스템오디오)를 녹음하는 API를 제공하지 않음.

* Android 10 이상으로 업데이트해야 내부사운드를 녹음할 수 있음.

 

'IT 일반 > 안드로이드' 카테고리의 다른 글

[ADB] am start -an 실행 시 Error 문제  (0) 2023.08.21

 

1) 액티비티 확인

앱에 특정 액티비티가 존재하는지를 명확히 확인하기 위해 dumpsys로 정보를 출력한다.

LAUNCHER 액티비티를 찾는다.

$ dumpsys package com.skmc.okcashbag.home_google
...(생략)...
9e46495 com.skmc.okcashbag.home_google/.activities.Entrypoint filter d2269aa
          Action: "android.intent.action.MAIN"
          Category: "android.intent.category.LAUNCHER"
          Category: "android.intent.category.DEFAULT"
...(생략)...

 

2) 오류확인

am start -an 명령어로 액티비티를 실행한다.

액티비티가 있는것을 확인하고 실행하였으나 존재하지 않는다고 오류 메시지를 출력한다

$ am start -an com.skmc.okcashbag.home_google
Starting: Intent { act=n pkg=com.skmc.okcashbag.home_google }
Error: Activity not started, unable to resolve Intent { act=n flg=0x10000000 pkg=com.skmc.okcashbag.home_google }

 

3) 해결방법

이럴 경우  am start-activity 를 이용하여 앱을 시작할 수 있다.

$ am start-activity com.skmc.okcashbag.home_google/.activities.Entrypoint
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.skmc.okcashbag.home_google/.activities.Entrypoint }

 

4) 왜 발생할까?

우선 확인된 내용은 앱의 targetSdk 버전이 33일 경우 am start -an 으로 실행되지 않는다는 점이다.

앱의 targetSdk 버전이 32 이하의 패키지는 모두 am start -an 으로 실행가능했다.

com.tmon
    versionCode=23005941 minSdk=23 targetSdk=33

$ am start -an com.tmon/.splash.SplashActivity
Starting: Intent { act=n cmp=com.tmon/.splash.SplashActivity }
Error type 3
Error: Activity class {com.tmon/com.tmon.splash.SplashActivity} does not exist.
com.hnsmall
    versionCode=531 minSdk=21 targetSdk=32

$ am start -an com.hnsmall/.presentation.MainActivity
Starting: Intent { act=n cmp=com.hnsmall/.presentation.MainActivity }

 

targetSdk 33은 Android 13에 해당하는 버전이다.

위 정보로 짐작컨데 Android 13 앱에 대한 권한 변경으로 발생한 문제로 보인다.

'IT 일반 > 안드로이드' 카테고리의 다른 글

[기록] Android에서 화면녹화  (0) 2023.09.15

보안프로그램에 의해 수정이 불가능할 때, Terminer에서 변경해야한다.

기본 명령어

// get, set 기준. 다른 옵션은 help 확인
$ scutil --get pref

 

컴퓨터이름 설정하기

$ sudo scutil --set ComputerName "NewName"

 

컴퓨터이름 가져오기

$ scutil --get ComputerName

 

기타

$ scutil --get LocalHostName
$ scutil --get HostName

 

'IT 일반' 카테고리의 다른 글

Android Screen Mirroring - SCRCPY  (0) 2021.08.04
MIUI에서 ADB로 input device 제어할 때 설정방법  (0) 2019.05.16

Git : https://github.com/Genymobile/scrcpy

 

GitHub - Genymobile/scrcpy: Display and control your Android device

Display and control your Android device. Contribute to Genymobile/scrcpy development by creating an account on GitHub.

github.com

 

1. Mac에서 설치 시 Xcode가 미리 설치되어있어야 한다.

xcode-select --install

 

2. Mac에서 설치 시 brew가 미리 설치되어있어야 한다.

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

 

3. scrcpy 설치

brew install scrcpy

 

4. 실행

% adb devices
192.168.22.20:5555 device
192.168.22.30:5555 device
192.168.22.37:5555 device
% scrcpy -s 192.168.22.37
2021-08-04 14:44:16.224 scrcpy[15489:911208] INFO: scrcpy 1.17 <https://github.com/Genymobile/scrcpy>
adb: error: failed to get feature set: device '192.168.22.37' not found
2021-08-04 14:44:16.230 scrcpy[15489:911208] ERROR: "adb push" returned with value 1
scrcpy(15489,0x11e4a0e00) malloc: *** error for object 0x7fb3aa6070e0: pointer being freed was not allocated
scrcpy(15489,0x11e4a0e00) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      scrcpy -s 192.168.22.37
rei@reid-1pc bin % scrcpy -s 192.168.22.30
2021-08-04 14:44:18.187 scrcpy[15491:911400] INFO: scrcpy 1.17 <https://github.com/Genymobile/scrcpy>
/usr/local/Cellar/scrcpy/1.17_1/share/scrcpy/s...d, 0 skipped. 0.6 MB/s (34930 bytes in 0.057s)
adb: error: more than one device/emulator
2021-08-04 14:44:18.291 scrcpy[15491:911400] ERROR: "adb reverse" returned with value 1
2021-08-04 14:44:18.291 scrcpy[15491:911400] WARN: 'adb reverse' failed, fallback to 'adb forward'
27183
[server] INFO: Device: samsung SM-N920S (Android 7.0)
2021-08-04 14:44:19.168 scrcpy[15491:911400] INFO: Renderer: metal
2021-08-04 14:44:19.172 scrcpy[15491:911400] INFO: Initial texture: 1080x1920

 

일반적인 제조사(삼성, LG)의 경우에는 adb shell 권한일 경우 접근 가능한 /dev/input/event가 MIUI에서는 개발자 옵션을 활성화 하더라도 기본적으로 사용할 수 없습니다.

 

이는 adb shell(uid 2000)이 관련 권한이 빠져있기 때문이며, 이를 해결하기 위해서는 adb shell 권한으로 제어하기 위해서는 USB 디버깅(보안 설정) 메뉴를 활성화 해야합니다.

 

adb shell을 이용하여 Android에 접속 후 id 명령어를 입력하여 소속된 그룹의 ID(GID)를 확인합니다.

아래의 그림에서 보면 adb shell에 input 그룹(GID 1004)이 미포함 되어있음을 확인할 수 있습니다.

 

 

1) 개발자 옵션 메뉴에 진입 후 USB 디버깅(보안 설정)을 활성화 시도합니다.

 

2) 경고에 대한 1차 설명을 볼 수 있습니다. 5초 대기 후 승인합니다.

 

3) 경고에 대한 2차 설명을 볼 수 있습니다. 5초 대기 후 승인합니다. 

 

4) 마지막 확인창입니다. 5초 대기 후 승인합니다.

 

 

5) 설정 완료

 

USB 디버깅(권한 설정)를 허용 후 조회하면 1004(input) 그룹이 추가되었습니다.

 

이제 adb shell에서 /dev/input/event를 제어할 수 있습니다.

'IT 일반' 카테고리의 다른 글

[MacOS] 컴퓨터이름을 Command로 변경하기  (0) 2023.04.06
Android Screen Mirroring - SCRCPY  (0) 2021.08.04

+ Recent posts