'개발이야기/Android'에 해당되는 글 2건

  1. 안드로이드 ADB Shell 권한변경 (su)
  2. 이클립스에서 NDK 디버깅하기 3

안드로이드 폰을 루팅하였음에도 불구하고 커멘드에서 adb shell 을 입력하였을때 바로 su 권한을 얻지못하고 $표시로 나오는경우, 아래와 같은 방법으로 su 권한을 획득할 수 있다.

1. adb shell 

2. su  

3. mount -o remount,rw /system (or: adb remount)

4. ls -la /system/bin/sh
   lrwxr-xr-x root shell 2012-11-10 15:20 sh -> mksh  

5. chmod 4755 /system/bin/sh

6. ls -la /system/bin/mksh 
   -rwsr-xr-x root shell 157520 2012-11-10 09:54 mksh (notice the suid bit is set)  

7. ^D (exit) 

8. adb shell


su 권한을 획득하면 개발환경에서 프로그램의 빌드후 실행이나 adb install 명령어 설치등 제대로 동작하지 않는다.

따라서 이때는 su권한을 풀어주어야 한다.

1. adb shell

2. mount -o remount,rw /system (or: adb remount)

3. chmod 755 /system/bin/sh

4. ^D (exit)

5. adb shell


'개발이야기 > Android' 카테고리의 다른 글

이클립스에서 NDK 디버깅하기  (3) 2012.11.01
1. CDT 설치
The NDK plugin currently works with CDT 7.0.2 or CDT 8.0.2.
    1. Download Eclipse for Java.
    2. Install CDT from Eclipse update site http://download.eclipse.org/tools/cdt/releases/indigo. (indigo: 버전이름)
    3. Install Android SDK + NDK Plugins from Eclipse update site https://dl-ssl.google.com/android/eclipse/

2. NDK 플러그인 사용
1. First set the path to SDK and NDK:
    Eclipse -> Window -> Preferences -> Android -> set path to SDK
    Eclipse -> Window -> Preferences -> Android -> NDK -> set path to the NDK

2. Right click on an Android project and select `Android Tools -> Add native support`.
Note that you will not be able to add native support if the project already has C/C++ nature.

At this point, you will be able to build your applications using Project -> Build All.

3. NDK 디버깅
1. Update your build config to include NDK_DEBUG = 1.
    Right click project -> properties -> C/C++ Build:
2. Set a breakpoint in your C code. 3. Right click on your project, select Debug As -> Android Native Application Note: There is a delay of a few seconds between when the activity is launched and when native debugging starts. If your code is already executed by that point, then you won’t see the breakpoint being hit. So either put a breakpoint in code that is called repetitively, or make sure that you call JNI code after you see that ndk-gdb has connected.

4. 이클립스 환경설정
Eclipse -> Window -> Preferences -> C/C++ -> Code Analysis
Syntax and semantic Errors 체크 해제 (체크 해제 안할 경우 구문에러 인식하여 빌드되지 않습니다.)


참조: http://tools.android.com/recent/usingthendkplugin


'개발이야기 > Android' 카테고리의 다른 글

안드로이드 ADB Shell 권한변경 (su)  (0) 2013.01.02