본문 바로가기
앱 개발하기

앱(app) 가동하기

by 노화방지 Anti-aging Hairstyle 2015. 12. 14.
반응형

Running Your App   앱 가동하기

 

Previous                 Next

 

This lesson teaches you to

1.       Run on a Real Device

2.       Run on the Emulator

You should also read

·        Using Hardware Devices

·        Managing AVDs with AVD Manager

·        Managing Projects

If you followed the previous lesson to create an Android project, it includes a default set of "Hello World" source files that allow you to immediately run the app.
이전 단원에서 안드로이드 프로젝트 생성에 관하여 배운 경우, 바로 app 행할 있도록 "Hello World" 소스 파일 기본 세트가 포함되어 있습니다.

How you run your app depends on two things: whether you have a real device running Android and whether you're using Android Studio. This lesson shows you how to install and run your app on a real device and on the Android emulator, and in both cases with either Android Studio or the command line tools.
가동 방법은 다음 2가지가 있습니다: 안드로이드를 실행을 위한 실제 장비와 안드로이드 스튜디오. 단원에서는 실제 장비와 안드로이드 에뮬레이터에 앱을 설치하고 실행하는 방법, 그리고 경우에 안드로이드 스튜디오 또는 명령줄 도구

Run on a Real Device   실제 장비에서 가동시키기
If you have a device running Android, here's how to install and run your app.
안드로이드가 가동되는 장비를 갖고 있다면 앱을 설치하고 가동시키는 방법이 여기 있습니다.

Set up your device   장비 설정하기

1.       Plug in your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the OEM USB Drivers document.
USB
케이블을 사용하여 장치를 개발 머신에 연결합니다. Windows에서 개발하는 경우에, 장치에 적합한 USB 드라이버를 설치해야 수도 있습니다. 드라이버 설치에 관한 도움은, OEM USB Drivers 문서 참조하십시오.

2.       Enable USB debugging on your device.

o   On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
Android 3.2
이상을 가동 중인 대부분의 장치에서, you can find the option under Settings > Applications > Development.

o   On Android 4.0 and newer, it's in Settings > Developer options.
Android 4.0
이상에서는, it's in Settings > Developer options 입니다.

Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.

Run the app from Android Studio   안드로이드 스튜디오로부터 앱을 가동하기

1.       Select one of your project's files and click Run http://developer.android.com/images/tools/as-run.png from the toolbar.
your project's
파일들 하나를 선택한 다음, 툴바로부터 Run http://developer.android.com/images/tools/as-run.png  클릭하십시오.

2.       In the Choose Device window that appears, select the Choose a running device radio button, select your device, and click OK .
나타나는 Choose Device window 안에서, Choose a running device radio button 선택한 다음, your device 선택하고, OK  클릭하십시오.

Android Studio installs the app on your connected device and starts it.
Android Studio
your connected device 앱을 설치한 다음 그것을 시작시킵니다.

Run the app from a command line

Open a command-line and navigate to the root of your project directory. Use Gradle to build your project in debug mode, invoke the assembleDebug build task using the Gradle wrapper script (gradlew assembleRelease).
명령 줄을 열고 프로젝트 디렉토리의 루트로 이동합니다.Gradle 래퍼 스크립트 (gradlew assembleRelease) 사용하여 assembleDebug 빌드 작업을 디버그 모드에서 프로젝트를 빌드 호출 Gradle 사용합니다.

This creates your debug .apk file inside the module build/ directory, named MyFirstApp-debug.apk.

On Windows platforms, type this command:

> gradlew.bat assembleDebug

On Mac OS and Linux platforms, type these commands:

$ chmod +x gradlew
$
./gradlew assembleDebug

After you build the project, the output APK for the app module is located in app/build/outputs/apk/

Note: The first command (chmod) adds the execution permission to the Gradle wrapper script and is only necessary the first time you build this project from the command line.

Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute:

adb install app/build/outputs/MyFirstApp-debug.apk

On your device, locate MyFirstApp and open it.

That's how you build and run your Android app on a device! To start developing, continue to the next lesson.

Run on the Emulator  에뮬레이터 가동하기
Whether you're using Android Studio or the command line, to run your app on the emulator you need to first create an Android Virtual Device (AVD). An AVD is a device configuration for the Android emulator that allows you to model a specific device.
안드로이드 스튜디오 또는 명령줄을 사용하든 에뮬레이터에서 앱을 실행하려면, 먼저 안드로이드 가상 장치(Android Virtual Device(AVD)) 만들어야 합니다. AVD 특정 장치를 모델링 있는, 안드로이드 에뮬레이터에 대한 장치 구성입니다.

Create an AVD

1.       Launch the Android Virtual Device Manager:                드로이드 가상장치 관리자를 시작하십시오:

o   In Android Studio, select Tools > Android > AVD Manager, or click the AVD Manager icon http://developer.android.com/images/tools/avd-manager-studio.png in the toolbar.
안드로이드 스튜디오에서, Tools > Android > AVD Manager 선택하거나 또는 툴바에서 AVD Manager icon http://developer.android.com/images/tools/avd-manager-studio.png  클릭하십시오.

o   Or, from the command line, change directories to sdk/ and execute:
또는 커맨드 라인에서 디렉토리 sdk/ 변경한 다음 실행시키십시오:

tools/android avd

Note: The AVD Manager that appears when launched from the command line is different from the version in Android Studio, so the following instructions may not all apply.
: 커맨드 라인에서 시작하는 경우 나타나는 AVD 매니저는 안드로이드 스튜디오에서 나타나는 것과 다르기 때문에 다음 지침이 모두 적용되지 않을 수도 있습니다.


2.       On the AVD Manager main screen (figure 1), click Create Virtual Device.

AVD Manager main screen (그림1) 위에서, Create Virtual Device 클릭하십시오.

3.       In the Select Hardware window, select a device configuration, such as Nexus 6, then click Next.
Select Hardware
창에서 Nexus 6 같은 장치 컨피규레이션을 선택한 다음, Next 클릭하십시오.

4.       Select the desired system version for the AVD and click Next.
AVD
대한 요구되는 시스템 버전을 선택한 다음 Next 클릭하십시오.

5.       Verify the configuration settings, then click Finish.
configuration settings
검증한 다음, Finish 클릭하십시오.

For more information about using AVDs, see Managing AVDs with AVD Manager.

Run the app from Android Studio

1.       In Android Studio, select your project and click Run http://developer.android.com/images/tools/as-run.png from the toolbar.
Android Studio
에서 project 선택한 다음, 툴바에 있는 Run http://developer.android.com/images/tools/as-run.png  클릭하십시오.

2.       In the Device Chooser window, click the Launch emulator radio button.
Device Chooser window
에서, Launch emulator radio 버튼을 클릭하십시오.

3.       From the Android virtual device pull-down menu, select the emulator you created, and click OK.
Android virtual device pull-down
메뉴로부터, 이미 만든 emulator 선택한 다음, OK 클릭하십시오.

It can take a few minutes for the emulator to load itself. You may have to unlock the screen. When you do, My First App appears on the emulator screen.
에뮬레이터 자체를 로드하는데 분이 걸릴 있습니다. 화면 잠금을 해제해야 수도 있습니다. 로드하면, My First App  에뮬레이터 화면에 나타납니다.

Run your app from the command line

1.       Build the project from the command line. The output APK for the app module is located inapp/build/outputs/apk/.

2.       Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable.

3.       Execute this command:

adb install app/build/outputs/MyFirstApp-debug.apk

4.       On the emulator, locate MyFirstApp and open it.

That's how you build and run your Android app on the emulator! To start developing, continue to the next lesson.

Next: Building a Simple User Interface 

 

반응형

댓글