'2011/11/21'에 해당되는 글 2건

  1. 2011.11.21 adb 사용 예제
  2. 2011.11.21 안드로이드 소스 편하게 보기 - 삼바 서버 설치


> adb shell
간단한 명령어
# pwd
# cd /
# ls
# ps
# netstat
# getprop

property 지정 (init 프로세스에서 property의 변경사항을 모니터링하다가 ctl.start나 ctl.stop이 오면 service를 시작 또는 종료한다.)

 # setprop ctl.start bootanim
setprop ctl.start bootanim
# setprop ctl.stop bootadnim
setprop ctl.stop bootadnim

참고
특별히 고치지 않은 버전에서의 root/init.rc 파일 에는 다음 설정이 있다.
service bootanim /system/bin/bootanimation
    user graphics
    group graphics
    disabled
    oneshot 

이미 서비스로 등록되어 있는 bootanimation을 내리고 올리는 작업을 할 수 있다.



# getprop ro.debuggable
getprop ro.debuggable
1
# setprop ro.debuggable 0
setprop ro.debuggable 0

# getprop persist.service.adb.enable
getprop persist.service.adb.enable
1
# setprop persist.service.adb.enable 0
setprop persist.service.adb.enable 0
#
여기서 adb가 죽고, 튕겨나감
>adb shell
error: device not found

avd를 다시 실행한다.


>adb devices
List of devices attached
emulator-5554   device

>adb -s emulator-5554 get-state
device

>adb -d get-serialno
unknown


>adb -s emulator-5554 kill-server


>adb -s emulator-5554 start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *


local 파일을 에뮬로 복사
>adb -s emulator-5554 push c:\1.jpg /data/1.jpg
689 KB/s (154474 bytes in 0.218s)


에뮬에 있는 apk 를 local로 복사
>adb -s emulator-5554 pull /data/app/ApiDemos.apk c:\ApiDemos.apk
212 KB/s (2409035 bytes in 11.093s)


export 해서 apk 만들기
http://blog.naver.com/minroud?Redirect=Log&logNo=80130874162

>adb -s emulator-5554 -e install HelloAndroid1.apk
140 KB/s (13515 bytes in 0.093s)
        pkg: /data/local/tmp/HelloAndroid1.apk
Success

(이클립스 데몬에서 올라가는 것 확인)

혹시 똑같은 apk가 있어서 설치가 안되면 강제로 설치하도록 함
(Failure [INSTALL_FAILED_ALREADY_EXISTS] 무시)

>adb -s emulator-5554 -e install -r  HelloAndroid1.apk
13 KB/s (13515 bytes in 1.000s)
        pkg: /data/local/tmp/HelloAndroid1.apk
Success

uninstall 할때는 패키지명으로 삭제해야 함
>adb -s emulator-5554 uninstall com.google.HelloAndroid

 

# service list
service list
Found 49 services:
0       phone: [com.android.internal.telephony.ITelephony]
1       iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo]
2       simphonebook: [com.android.internal.telephony.IIccPhoneBook]
3       isms: [com.android.internal.telephony.ISms]
4       diskstats: []
5       appwidget: [com.android.internal.appwidget.IAppWidgetService]
..

# service call activity 1598968902
service call activity 1598968902
Result: Parcel(
  0x00000000: 0000001c 006e0061 00720064 0069006f '....a.n.d.r.o.i.'
  0x00000010: 002e0064 00700061 002e0070 00410049 'd...a.p.p...I.A.'
  0x00000020: 00740063 00760069 00740069 004d0079 'c.t.i.v.i.t.y.M.'
  0x00000030: 006e0061 00670061 00720065 00000000 'a.n.a.g.e.r.....')
#
 

Posted by '김용환'
,



vmware에 ubuntu 운영체제에 안드로이드 소스 설치후에 소스를 볼라면, vi와 cscope의 달인이 아니면 보기가 너무 힘들다.  그래서, 삼바 서버를 설치해두면 두고 두고 쓰기 편하다.

삼바를 설치후, 소스 보는 것이 편해진다.



삼바 설치

$ sudo apt-get install samba smbfs

삼바 환경설정

$ sudo gedit /etc/samba/smb.conf
#   security = user
-> (수정)
   security = user

 

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes
-> (추가)
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes
writable = yes


;   create mask = 0700
-> (수정)
   create mask = 0700

;   directory mask = 0700
-> (수정)
   directory mask = 0700

;   valid users = %S
-> (수정)
   valid users = %S



#======================= Share Definitions =======================
바로 밑에 추가


[root]
comment = Root
path = /
browable = yes
writable = yes





환경 설정 확인
root 계정 접근을 확인한다.

$ sudo testparm


....
[root]
 comment = Root Directory
 path = /
 valid users = %S
 read only = No
 create mask = 0700
 directory mask = 0700

......


패스워드 설정

$ sudo smbpasswd -a root
New SMB password:
Retype new SMB password:
Added user root.


ip 확인

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:ff:fb:0a 
          inet addr:192.168.150.128


리눅스에서 나와 윈도우 탐색기에서 접근
패스워드는 smbpasswd에서 입력한 계정 paswd 가능하다.





repo로 받은 안드로이드 소스 보기가 편하다..




* 예전(7,8년 전)에는 삼바 설정 파일 수정후에 삼바 데몬을 재시작했는데..
ubuntu 에서 설치후에는 samba 설정 파일만 수정하면, 알아서 자동으로 읽는다.. 완전 신기.
그리고, 속도도 빨라졌다. 삼바가 이렇게 좋아질 줄이야!!!



그리고, 이클립스를 이용해서 소스를 확인할 때 볼 수 있는 소스를 복사해서 사용한다.
framework/base/core/java 밑에 있는 파일을 로컬로 복사한다. 그리고, 이클립스에서 안드로이드 소스에 해당되는 곳에 F3를 눌러 복사한 folder 로 지정하서 소스를 보면 끝..

\\ip\안드로이드소스받은위치\frameworks\base\core\java


네트웍 드라이드 연결을 할 수 도 있다.
윈도우 탐색기->도구->네트웍드라이브 연결

드라이브이름과 , \\192.168.158.128\root\work 각각 넣어주고 엔터하면 접근된다.

Posted by '김용환'
,