노력과 삽질 퇴적물

유니티: 디버깅 방식 본문

프로그래밍note/엔진 관련

유니티: 디버깅 방식

MTG 2018. 8. 13. 22:22






1. Visual Studio Tools for Unity


통칭, UnityVS

유니티5.2이상 권장.

 

 Visual Studio 2015 Tools for Unity

 호환버전

> Visual Studio 2015 Community

> Visual Studio 2015 Professional

> Visual Studio 2015 Enterprise

 Visual Studio 2013 Tools for Unity

 호환버전
> Visual Studio 2013 Community
> Visual Studio 2013 Professional
> Visual Studio 2013 Enterprise

 Visual Studio 2012 Tools for Unity

 호환버전
> Visual Studio 2012 Professional
> Visual Studio 2012 Enterprise

 Visual Studio 2010 Tools for Unity

 호환버전

> Visual Studio 2010 Professional

> Visual Studio 2010 Enterprise


단축키

> F5: 중단점 단위로 이동

> F10: 중단점부터 순차적으로 로그추적이 가능.






2. CMD & adb logcat


* 안드로이드 SDK경로

> D:\dev_lib\android_sdk windows


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
 
C:\Users\ANALOG-GREEN>cd /d D:\dev_lib\android_sdk windows\platform-tools
 
D:\dev_lib\android_sdk_windows\platform-tools>adb logcat Unity:I Native:I *:S
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
I/Unity   (14112): onPause
I/Unity   (14112): windowFocusChanged: false
I/Unity   (15349): splash_mode = 0 (integer)
I/Unity   (15349): useObb = False (bool)
I/Unity   (15349): onResume
I/Unity   (15349): onPause
I/Unity   (15349): onConfigurationChanged
I/Unity   (15349): windowFocusChanged: true
I/Unity   (15349): onResume
... ... ...
cs


 adb logcat

 디바이스 자체에 발생하는 모든 로그를 모니터링

 adb -e logcat

 녹스 앱플레이어등 안드로이드 에뮬쪽 로그만 모니러팅

 adb logcat -s Unity

 유니티에서 발생하는 모든 로그를 모니터링

 adb logcat Unity:I Native:I *:S

 유니티 스크립트의 로그만 걸러서 보는데 유용.


버그가 나는 위치를 찾기 쉽게끔 Debug.Log를 구간별로 넣고 빌드&실행을 해야 합니다.






3. 유니티 스크립트 디버깅


* 케이블 연결상태가 좋지 않거나 로그캣이 번번히 끊길경우에 유용합니다.


1
2
//    [*.cs]
Log.log("unity src debug sample");
cs



실행후
(내외장 메모리)/android/(패키지명)/logs를 확인.






4. 녹스 앱플레이어 디버깅


0) 녹스 개발자 권한
안드로이드 스튜디오 NOX 연결(연동)하는 방법!!!



1) 연결

1
2
3
4
5
6
7
8
PS D:\nox\Nox\bin> ./nox_adb connect 127.0.0.1:62001
adb server version (39) doesn't match this client (36); killing...
* daemon started successfully *
connected to 127.0.0.1:62001
PS D:\nox\Nox\bin> ./adb devices
List of devices attached
127.0.0.1:62001 device
xxxxxxxxxx        unauthorized
cs



2) 디버깅 시작

1
2
PS D:\nox\Nox\bin> cd D:\dev_lib\android_sdk_windows\platform-tools
PS D:\dev_lib\android_sdk_windows\platform-tools> ./adb -e logcat
cs







기타.


Unity Remote 5 (앱)




 

 

 

참조자료.

 

Visual Studio Tools for Unity 시작

UnityVS 사용법 | Blue Water

Unity3D :: 유니티 안드로이드 디버깅 방법

Mr. 후크의 잡동사니 :: Unity에서 폰으로 디버그 하기( Unity Remote )

 

nox adb 연결



 


 

기타. 변경이력


일자

변경이력

2016-11-24

 초안

2018-08-13

 녹스기반 디버깅 추가 자료 추가