2012/02/23

Android 에뮬레이터에 가상 SD 카드 연결하기

Android 에뮬레이터를 만들때 SD Card 크기를 입력하는 부분이 있다.



이 부분에 크기를 입력하면 시스템의 User 폴더의 .android 폴더에 가상 머신 이름 폴더 안에 sdcard.img 파일로 생성이 된다. 시스템 폴더에 생성이 되는 것도 맘에 안들고 해서 다른 방법을 알아 보았다. 찾아보니 가상 SD Card 이미지를 만들고 파일을 연결하는 방법이 있었다.

 

우선 가상 SD Card 이미지를 만들어야 한다. Android SDK에 포함되어 있는 mksdcard.exe 프로그램으로 만들 수 있다. mksdcard.exe 는 SDK가 설치된 경로의 tools 폴더에 있다.



이 프로그램의 파라메터와 이미지 생성 방법은 아래와 같다.

D:\Dev\android_sdcard>..\android-sdk-windows    ools\mksdcard.exe
mksdcard: create a blank FAT32 image to be used with the Android emulator
usage: mksdcard [-l label]

if is a simple integer, it specifies a size in bytes
if is an integer followed by 'K', it specifies a size in KiB
if is an integer followed by 'M', it specifies a size in MiB
if is an integer followed by 'G', it specifies a size in GiB

Minimum size is 9M. The Android emulator cannot use smaller images.
Maximum size is 1099511627264 bytes, 1073741823K, 1048575M or 1023G

D:\Dev\android_sdcard>..\android-sdk-windows ools\mksdcard.exe 2G MyGB_SD.img

D:\Dev\android_sdcard>



이렇게 만들어진 파일을 Android 가상 머신 관리자에서 SD Card 부분에 입력을 해 주면 된다.



에뮬레이터에서 SD Card를 확인해 보았다.

<

Original Post : http://neodreamer-dev.tistory.com/646

No comments :

Post a Comment