'2014/01/07'에 해당되는 글 10건
- 2014.01.07 strncpy 로 메모리 복사
- 2014.01.07 C언어 배열 초기화 방법
- 2014.01.07 [디버깅] GDB 사용하기
- 2014.01.07 [디버깅] ndk stack 사용법
- 2014.01.07 adb 패스 설정
- 2014.01.07 [디버깅] visual studio에서 GDB 실행?
- 2014.01.07 [디버깅] cocos2d-x Debug 팁
- 2014.01.07 cocos2d-x 소스 코드 주소
- 2014.01.07 [디버깅] cocos2d-x Ant 사용법
- 2014.01.07 [팁] 안드로이드 cocos2d-x 디버깅 시
The strncpy() function is similar, except that not more than n bytes of
src are copied. Thus, if there is no null byte among the first n bytes
of src, the result will not be null-terminated.
이렇게 명시되어 있으니까요...
strncpy( dst, src, n ); dst[n] = '\0';
정도면 되지 않을까 싶은데요 :)
길이가 n보다 짧다면 null 까지 복사될테고... 아니라면 null terminated 라는 보장이 없으니까 후자일 경우에 한해서 문제를 일으키지 않도록 해주면 되겠죠
'잡다한것들전부 > C, C++, C#' 카테고리의 다른 글
| 추상 클래스 (C++) (0) | 2014.01.10 |
|---|---|
| Duff's Device (0) | 2014.01.10 |
| c++ 11 이란?? (0) | 2014.01.09 |
| strncpy 로 메모리 복사 (0) | 2014.01.07 |
| C언어 배열 초기화 방법 (0) | 2014.01.07 |
| c++ stl 관련 자료 (0) | 2014.01.06 |
1. int a[10] = { 0 };
2. int a[10] = { 0, };
3. int a[10];
memset ( a, 0, 10 );
1번이나 2번을 사용하자. (처음선언시) 나중에 초기화시는 무조건 MEMSET 사용
'잡다한것들전부 > C, C++, C#' 카테고리의 다른 글
| 추상 클래스 (C++) (0) | 2014.01.10 |
|---|---|
| Duff's Device (0) | 2014.01.10 |
| c++ 11 이란?? (0) | 2014.01.09 |
| strncpy 로 메모리 복사 (0) | 2014.01.07 |
| C언어 배열 초기화 방법 (0) | 2014.01.07 |
| c++ stl 관련 자료 (0) | 2014.01.06 |
ndk gdb 를 연결해서 디버깅 하셔야 합니다.
android manifest 에서 debuggable true 로 주는 옵션이 있는데
댓글로 설명하긴 조금 복잡하네요.
ndk gdb 연결해서 debug 하는 방법을 한번 찾아보셔요
에뮬에서만 되고 단말기에서는 안되나봄?
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [좌표] 좌표에 대해서 알아봅시다(convertToWorldSpace) 절대좌표 (0) | 2014.01.10 |
|---|---|
| [디자인패턴] cocos2d-x 싱글톤 싱글턴 패턴 구현 (0) | 2014.01.08 |
| [디버깅] GDB 사용하기 (0) | 2014.01.07 |
| [디버깅] ndk stack 사용법 (0) | 2014.01.07 |
| [디버깅] visual studio에서 GDB 실행? (0) | 2014.01.07 |
| [디버깅] cocos2d-x Debug 팁 (0) | 2014.01.07 |
I made a bit of a progress and I want to share what I did.
When you get errors like this on the LogCat, they are saved on $PROJECT_PATH/obj/local/armeabi where $PROJECT_PATH is the path to your cocos2d-x android project. To symbolicate the messages to something understandable, you can use the ndk-stack tool.
Open up the Terminal (or Cygwin, not sure though) and type in
where:
$ANDROID_NDK is the path to your android NDK
PROJECT_PATH is the path to your cocos2d-x android project
After that, you will get a stack trace which points to certain files and line number where the crash occurred. Something like this:
From the dump above, you can see that on Stack frame #01 points to TowerObj.cpp:150, so I can now go to TowerObj.cpp at line 150 and fix stuff.
Hope this helps.
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [디자인패턴] cocos2d-x 싱글톤 싱글턴 패턴 구현 (0) | 2014.01.08 |
|---|---|
| [디버깅] GDB 사용하기 (0) | 2014.01.07 |
| [디버깅] ndk stack 사용법 (0) | 2014.01.07 |
| [디버깅] visual studio에서 GDB 실행? (0) | 2014.01.07 |
| [디버깅] cocos2d-x Debug 팁 (0) | 2014.01.07 |
| cocos2d-x 소스 코드 주소 (0) | 2014.01.07 |
C:\Android\adt-bundle-windows-x86-20130729\adt-bundle-windows-x86-20130729\sdk\platform-tools
ADB(Android Debug Bridge)
http://developer.android.com/tools/help/adb.html
adb 는 Android Debug Bridge 의 약자로 안드로이드 디버그 기능을 한다고 보면 됩니다.
adb를 사용해서 에뮬레이터 및 장치를 이용할 수 있습니다.
adb 명령을 알아보기 위해 우선 adb.exe 가 있는 곳으로 이동합니다.
제가 테스트하는 환경에서 Android SDK 는 아래와 같습니다.
adbshell 에서 쓸수 있는 명령어 모음 입니다.
adb logcat -v time [filter]
시스템 기본정보: 하드웨어, 커널 등
cat /proc/version : 커널 버전
cat /proc/cpuinfo : 프로세서 정보, CPU타입, 모델 제조사 등
cat /porc/meminfo : 메모리 정보, 실제 메모리 및 가상 메모리
cat /proc/devices : 현재 커널에 설정되어 있는 장치 목록
mount : 마운트된 모든 장치 정보
df : 하드디스크 사용량
cat /porc/filesystems : 커널에 설정되어 있는 파일시스템 목록
cat /proc/swaps : 스왑 파티션의 크기와 사용량
cat /proc/interrupts : 장치가 사용중인 인터럽트(IRQ)목록 표시
cat /proc/ioports : 현재 사용중인 input/output 포트
cat /proc/partitions : 파티션 정보
cat /proc/uptime : 시스템이 얼마나 살아있었는지
cat /proc/stat : 시스템 상태에 관한 다양한 정보, CPU 사용 통계, 부팅이후 page fault 발생 횟수 등
cat /proc/zoneinfo : ZONEINFO
dmesg : 시스템 부팅시 나왔던 메시지
ps : 실행중인 프로세스 정보
ps -p - t : 프로세스와 쓰레드 목록
set or printenv : 환경설정값 출력
시스템 리소스 사용 현황
vmstat : 시스템 리소스 상황 모니터, CPU, I/O, Memory 등
cat /proc/diskstats : 디스크 utilization과 throughput. 즉 디스크 I/O현황
top : 시스템 프로세스 상황 모니터링/ 프로세스별 CPU사용량, 메모리와 스왑 사용량 등
procrank : 프로세스별 메모리
dumpsys meminfo [PID] : 해당 프로세스 메모리 상세 정보
cat /proc/[PID]/stat : 해당 프로세스에 대한 정보, 시작시간, 상태, CPU 사용량 등
cat /proc/[PID]/maps : 해당 프로세스의 메모리 맵 정보
cat /proc/vmstat : 버추얼 메모리 통계?
librank : 라이브러리별 메모리 사용량?
네트워크 관련
cat /proc/net/netlink : 네트워크 정보
netcfg : 네트워크 인터페이스와 IP주소 목록
netstat : 네트워크 연결상태 확인
nc : 네트워크용 cat 명령어(netcat)
ifconfig : 네트워크 인터페이스 설정 정보. 장치명을 파라미터로 받음. ip 주소. 서브넷마스크 등
tcpdump : 실시간 패킷 모니터링
iftop : 네트워크를 위한 top
route : 해당 호스트까지 연결하는 중간 경로 정보인 라우팅 테이블 표시
ping : 원격 호스트와의 연결 테스트
cat /proc/net/route : Route
안드로이드 제공
logcat : 로그캣 보기
pm : package manager의 약자. 패키지/permission/instrumentation/feature 목록, 패키지 설치/제거 등
am : activity manager의 약자, 액티비티 시작, Intent 브로드캐스팅, Instrumentation 시작, profiling 시작 / 중지 등
service : 안드로이드 서비스 목록 표시, 서비스에 명령 전달
monkey : 애플리케이션에 랜덤 이벤트 발생시킴. 사용자 이벤트, 시스템 이벤트의 무작위 발행
cat /data/anr/traces.txt : VM TRACES (쓰레드 덤프)
cat /proc/binder/proc/[PID] : 바인더 프로세스 상태
cat /proc/binder/xxx : 바인더 관련 정보(xxx은 transaction, transaction_log, failed_transaction_log, stats 등)
cat /data/system/packages.xml : 설치된 패키지 세팅 정보
setprop : system property 셋팅
getprop : 셋팅된 system property 목록 출력
종합 리포트
dumpsys [service] : app/service 상태정보 덤프, 서비스별로 추가 파라미터 받을 수 있음
dumpstate : device 상태정보 덤프. 상태정보를 추출하는 여러 명령어들의 조합으로 구성
dumpcrash : 애플리케이션이 crach될 때의 상태정보 덤프
bugreport : logcat + dumpsys + dumpstat
---------------------------------------------------------------------------------------------
ADB Shell Command - 15가지 팁
Basic Android Terminal and ADB Shell Command List
1. How to open a cmd in Android Phone
Method 1: “Start” ? “”Program”-” “Accessories” ? “” Command Prompt ”
Method 2: “Start” ? “” Run “, type cmd ENTER
2. How to restart Android Phone
When the phone and Computer is connected to the data cable, you can enter the following command
adb shell reboot === ENTER
3. Restart Android into Recovery Mode
With the data cable connected to your phone and computer, enter the following command
adb shell reboot recovery === ENTER
4. Convert back to ext2 partition
Restart the phone into Recovery mode, press “Alt + X” into the console. Open cmd and enter the following command
adb shell === ENTER
tune2fs-O ^ has_journal / dev/block/mmcblk0p2 === carriage return
e2fsck / dev/block/mmcblk0p2 === carriage return (optional, can be a problem area in section 2, when used)
5. Pulling applications from Android phone to computer
adb pull /system/sd/app app
adb pull /system/sd/app-private app-private
6. Pushing applications back to android phone from the computer
adb push app /system/sd/app
adb push app-private /system/sd/app-private
7. Delete existing apps on Android SD
adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/app-private
8. Repair gravity System or switch to screen
Sometimes frequent brushing of phone can cause gravity system or switch to screen failure. Just follow the steps below-
Restart the phone into Recovery mode, press “Alt + X” into the console
Open cmd and enter the following command
mount / data === carriage return
rm / data / misc / akmd * / data / misc / rild * === ENTER
9. Ext2/ext3/ext4 formatted partition
Enter the following command in the cmd
adb remount === ENTER
adb shell === ENTER
rm-r / system / sd / * === carriage return
10. Remove/ system / app under the application
Under normal circumstances / system / app is not under an application. Use the following methods to remove these applications.
Open cmd and enter the following command
adb remount === ENTER
adb rm / system / app / Stocks.apk === Enter
11. If the start Time is too Long
Just enter the following command in order to view the boot process.
adb logcat === ENTER
12. Through Terminal Partition SD card
It will erase everything on your SD card
$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)
13. From the Recovery Screen, send an update file to your SD card.
adb shell mount /sdcard
adb shell rm /sdcard/update.zip
adb push *filename* /sdcard/update.zip
14. Restoring a nandroid backup via Fastboot
Start command-prompt/terminal cd to the nandroid folder and enter following commands
fastboot erase boot
fastboot erase recovery
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash recovery recovery.img
fastboot reboot
15. Clear Search History in Android
Search History is accounted for Mobile Memory. It can also leak your privacy information as well. Just follow the steps below to clear android history.
Steps are as follows:
1. Make sure your mobile phone has Root authority.
2. Open the super-terminal.
3. Enter the following command
su
rm / data / data / com.android.vending / databases / suggestions.db
4. Exit Hyper Terminal and restart the phone.
---------------------------------------------------------------------------------------------
adb devices
adb 서버가 인식한 휴대폰과 에뮬레이터 목록을 보여준다.
연결된 devices의 TCP/IP 포트 번호를 알아낼 때 도움이 된다.
다른 명령어를 사용할 때, -s나 -e 옵션은 여러 개의 장치를 연결했을 때 특정한 디바이스를 지정할 때 사용한다.
예)
디바이스 검색
adb devices
adb shell
타겟 시스템의 쉘에 연결하고 # 프롬프트를 띄운다. 쉘은 간소한 유닉스 쉘 같아서 간단한 명령으로 타겟 시스템을 탐색하고 수정할 수 있다.
예)
여러 단말기 중에 하나를 선택해서 접속할 때,
adb -s emulator-5554 shell
adb install [-l][-r] file_spec
app을 설치하거나 재설치할 때 사용한다.
-l : 다른 장치로 복사돼 넘어가는 것을 막는다.
-r: 이미 존재하는 app 데이터를 지우지 않은 채 어플리케이션을 재설치 한다.
file_spec: 설치할 app의 .apk 파일
예)
파일 설치시
adb install c:\download\HangulKeyboard.apk
adb uninstall [-k] package
패키지 이름을 가진 app을 제거하다.
-k : app의 데이터를 보존한다.
package: 패키지의 전체 경로, .apk 확장자는 빼야 한다.
예)
패키지 삭제시
adb unstall com.falinux.android.hello
adb push local remote
개발자 컴퓨터에 있는 local이란 이름을 가진 파일을 타겟 시스템에 remote란 이름으로 복사한다.
예)
com.falinux.android.rose.apk 파일을 안드로이드 기기 /data/app/ 폴더 안으로 집어넣을 때,
adb push c:\com.falinux.android.rose.apk /data/app/
adb pull remote local
타겟 시스템에 있는 remote라는 파일을 개발자 컴퓨터에 local이란 이름으로 복사한다.
예)
안드로이드 기기 /data/app/com.falinux.android.rose.apk 파일을 C 드라이브로 가져올 때,
adb pull /data/app/com.falinux.android.rose.apk c:\com.falinux.android.rose.apk
adb reboot
안드로이드 시스템을 리부팅 시킨다.
adb kill-server
adb 에 문제가 있을 경우, adb를 종료시킨다.
adb start-server
종료된 adb를 실행 시킨다.
'잡다한것들전부 > 안드로이드' 카테고리의 다른 글
| 구글 인앱 빌링 ver 3 item already owned 오류시 해결방법 (0) | 2014.01.13 |
|---|---|
| 구글 안드로이드 인앱결제 관련 인앱빌링 ver3 적용 (0) | 2014.01.13 |
| adb 패스 설정 (0) | 2014.01.07 |
| 안드로이드 동적 생성 view button progressbar 등 (0) | 2014.01.06 |
| 뒤로가기 버튼 클릭시 종료 팝업후 종료 하기 (0) | 2013.12.30 |
| INSTALL_FAILED_INSUFFICIENT_STORAGE 오류시 (0) | 2013.12.30 |
http://visualgdb.com/tutorials/android/
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [디버깅] GDB 사용하기 (0) | 2014.01.07 |
|---|---|
| [디버깅] ndk stack 사용법 (0) | 2014.01.07 |
| [디버깅] visual studio에서 GDB 실행? (0) | 2014.01.07 |
| [디버깅] cocos2d-x Debug 팁 (0) | 2014.01.07 |
| cocos2d-x 소스 코드 주소 (0) | 2014.01.07 |
| [디버깅] cocos2d-x Ant 사용법 (0) | 2014.01.07 |
NFIsNOT//최근 버전에서는 ndkgdb.sh 파일이 추가되었습니다.
환경변수만 복사해서 이클립스에 추가하고 디버깅 걸어주면 디버깅이 뙇!!
ndk-stack 한번 써보세요
네이티브에서 뻗으면 스택이 찍혀요
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [디버깅] ndk stack 사용법 (0) | 2014.01.07 |
|---|---|
| [디버깅] visual studio에서 GDB 실행? (0) | 2014.01.07 |
| [디버깅] cocos2d-x Debug 팁 (0) | 2014.01.07 |
| cocos2d-x 소스 코드 주소 (0) | 2014.01.07 |
| [디버깅] cocos2d-x Ant 사용법 (0) | 2014.01.07 |
| [팁] 안드로이드 cocos2d-x 디버깅 시 (0) | 2014.01.07 |
https://github.com/syuhari/cocos2dx_recipe
| cocos2d-x 개발하시는 분들에게 제일 필요한 말대신 상황별 예제만 모아놓은 책 |
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [디버깅] visual studio에서 GDB 실행? (0) | 2014.01.07 |
|---|---|
| [디버깅] cocos2d-x Debug 팁 (0) | 2014.01.07 |
| cocos2d-x 소스 코드 주소 (0) | 2014.01.07 |
| [디버깅] cocos2d-x Ant 사용법 (0) | 2014.01.07 |
| [팁] 안드로이드 cocos2d-x 디버깅 시 (0) | 2014.01.07 |
| cocos2d-x 로딩 관련 (0) | 2014.01.06 |
cocos2d-x 로 개발하면서 디버그는 포기했네요....
배시쉘이나 기타 쉘에 path는 따로 지정해야 하며 툴 위치 역시 지정해야 합니다.
그리고 cocos sdk폴더가 아닌 외부에서 빌드하실려면 코코스 위치 정보를 지정해야 합니다.
거기에 필요한게 ndk_module_path 인데요.
($(call import-module,cocos2dx) 같은거 호출을 위해 필요)
이건 프로젝트 폴더에 보면 buid_native.sh가 있습니다. 그안에 젤 밑에 줄에 보면 있어요.
거기에 지정하시면 됩니다.;
그러면 빌드되요.
이후 ant를 써서 ant debug라고 치시면 패키징이 만들어집니다.
이 패키지를 adb install을 통해 디바이스에 올리시면 됩니다.
그리고 디버깅은 포기하세요.. ㅋㅋ vc환경에서 dll물려서 하는 방법도 있긴 하지만 그건 비추이구요.;
'잡다한것들전부 > 팁' 카테고리의 다른 글
| [디버깅] cocos2d-x Debug 팁 (0) | 2014.01.07 |
|---|---|
| cocos2d-x 소스 코드 주소 (0) | 2014.01.07 |
| [디버깅] cocos2d-x Ant 사용법 (0) | 2014.01.07 |
| [팁] 안드로이드 cocos2d-x 디버깅 시 (0) | 2014.01.07 |
| cocos2d-x 로딩 관련 (0) | 2014.01.06 |
| cocos2d-x 샘플 소스 소개 (0) | 2014.01.06 |
출처 : http://www.androidpub.com/1943024
ndk 디버그
Apache Ant
| 개발자 | 아파치 소프트웨어 재단 |
|---|---|
| 최근 버전 | 1.9.2 / 2013년 7월 12일 |
| 프로그래밍 언어 | 자바 |
| 운영 체제 | 크로스 플랫폼 |
| 종류 | 빌드 도구 |
| 라이선스 | 아파치 라이선스 2.0 |
| 웹사이트 | http://ant.apache.org |
Apache Ant는 자바 프로그래밍 언어에서 사용하는 자동화된 소프트웨어 빌드 도구이다. 유닉스나 리눅스에서 사용되는 make와 비슷하나 자바언어로 구현되어 있어 자바 실행환경이 필요하며 자바 프로젝트들을 빌드하는데 표준으로 사용된다.
make와 눈에 띄는 가장 다른 부분은 빌드를 위한 환경구성을 XML 파일을 사용한다는 점이다. 기본적인 빌드 파일명은 build.xml 이다.
로고는 이름(ANT)에 따라 개미 모양으로 만들어졌으나 이는 Another Neat Tool의 약어라고 한다. [1]
최초 빌드 도구로서 제작되었으나 점점 많은 기능이 추가되면서 빌드와 배포, 유닛 테스트 등을 포함하는 통합 툴로서 발전되고 있다.
역사[편집]
Ant는 선 마이크로시스템즈에서 나중에 톰캣으로 발전하게 되는 JSP/Servlet 표준구현 엔진을 오픈소스화 하던 중 제임스 던컨 데이비슨에 의해 최초로 구상되었다. 사유 소프트웨어인 make를 이용하여 솔라리스에서 작업했으나 다른 환경에서는 이를 수행할 수 있는 오픈소스 소프트웨어가 없었기 때문이다.
Ant의 최초 버전은 시스템 독립적으로 톰캣을 빌드하기 위한 툴로서 생겨났으며 2000년 7월 19일 독립형 제품으로서 발표되었다(1.1 버전). 처음에는 자카르타 프로젝트의 하위 프로젝트로서 시작했으나 2002년 10월 18일 아파치의 최상위 프로젝트로 승격해서 현재에 이르고 있다.
수많은 오픈소스가 Ant 를 통한 자동 빌드를 지원하고 있으며 명실상부한 자바 프로젝트의 공식적인 빌드 도구로서 사용된다.
버전별 최소 요구 자바 버전[편집]
Apache Ant는 각 버전별로 다음과 같은 최소 자바 버전을 요구한다. 단, 컴파일 작업이 필요하기 때문에 JRE가 아닌 JDK가 필요하며 일부 필수 패키지가 아닌 선택적 패키지의 경우는 아래 내용보다 더 높은 버전을 요구할 수 있다. [2]
| Ant 버전 | 최소 자바 버전 |
|---|---|
| 1.1 ~ 1.5.4 | 1.1 |
| 1.6.0 ~ 1.6.5 | 1.2 |
| 1.7.0 ~ 1.7.1 | 1.3 |
| 1.8.0 ~ 1.8.3 | 1.4 |
| 현재 개발버전(SVN trunk) | 1.5(5.0) |
같이 보기[편집]
참고 자료[편집]
- ↑ (영어) Apache Ant - FAQ. 아파치 소프트웨어 재단. 2012년 6월 17일에 확인.
- ↑ (영어) Which version of Java is required to run Apache Ant?. 아파치 소프트웨어 재단. 2012년 6월 17일에 확인.
바깥 고리[편집]
- (영어) Apache Ant 공식 홈페이지
'잡다한것들전부 > 팁' 카테고리의 다른 글
| cocos2d-x 소스 코드 주소 (0) | 2014.01.07 |
|---|---|
| [디버깅] cocos2d-x Ant 사용법 (0) | 2014.01.07 |
| [팁] 안드로이드 cocos2d-x 디버깅 시 (0) | 2014.01.07 |
| cocos2d-x 로딩 관련 (0) | 2014.01.06 |
| cocos2d-x 샘플 소스 소개 (0) | 2014.01.06 |
| 영어와 숫자만 가능하게 처리하기 (0) | 2014.01.02 |
그냥가자
아즈라엘


저는 그냥 gdb로 직접 조회하는 편이긴 한데... /obj/local/armeabi 이게 핵심이네요...