Moderator, Bürokraten, Checkuser-Berechtigte, developer, emailconfirmed, Oberflächenadministratoren, Oversighter, Administratoren
11.008
Bearbeitungen
Keine Bearbeitungszusammenfassung |
|||
Zeile 1: | Zeile 1: | ||
<languages /> | |||
<translate> | |||
If you followed the [[Spezial:MyLanguage/Android Training/Creating an Android Project|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. | If you followed the [[Spezial:MyLanguage/Android Training/Creating an Android Project|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. | ||
Zeile 23: | Zeile 25: | ||
This creates your debug <code>.apk</code> file inside the module <code>build/</code> directory, named <code>MyFirstApp-debug.apk</code>. | This creates your debug <code>.apk</code> file inside the module <code>build/</code> directory, named <code>MyFirstApp-debug.apk</code>. | ||
On Windows platforms, type this command: | On Windows platforms, type this command:</translate> | ||
> gradlew.bat assembleDebug | > gradlew.bat assembleDebug | ||
On Mac OS and Linux platforms, type these commands: | <translate> | ||
On Mac OS and Linux platforms, type these commands:</translate> | |||
$ chmod +x gradlew | $ chmod +x gradlew | ||
$ ./gradlew assembleDebug | $ ./gradlew assembleDebug | ||
<translate> | |||
After you build the project, the output APK for the app module is located in <code>app/build/outputs/apk/</code> | After you build the project, the output APK for the app module is located in <code>app/build/outputs/apk/</code> | ||
'''Note:''' The first command (<code>chmod</code>) adds the execution permission to the Gradle wrapper script and is only necessary the first time you build this project from the command line. | '''Note:''' The first command (<code>chmod</code>) 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 <code>platform-tools/</code> directory is included in your <code>PATH</code> environment variable, then execute: | Make sure the Android SDK <code>platform-tools/</code> directory is included in your <code>PATH</code> environment variable, then execute:</translate> | ||
adb install app/build/outputs/MyFirstApp-debug.apk | adb install app/build/outputs/MyFirstApp-debug.apk | ||
<translate> | |||
On your device, locate ''MyFirstApp'' and open it. | On your device, locate ''MyFirstApp'' and open it. | ||
Zeile 45: | Zeile 50: | ||
# Launch the Android Virtual Device Manager: | # Launch the Android Virtual Device Manager: | ||
#* In Android Studio, select '''Tools > Android > AVD Manager''', or click the AVD Manager icon in the toolbar. | #* In Android Studio, select '''Tools > Android > AVD Manager''', or click the AVD Manager icon in the toolbar. | ||
#* Or, from the command line, change directories to <code>sdk/</code> and execute: | #* Or, from the command line, change directories to <code>sdk/</code> and execute:</translate> | ||
#: <code>tools/android avd</code> | #: <code>tools/android avd</code> | ||
#:'''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. | #: <translate>'''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. | ||
# On the AVD Manager main screen (figure 1), click '''Create Virtual Device'''. | # On the AVD Manager main screen (figure 1), click '''Create Virtual Device'''. | ||
# In the Select Hardware window, select a device configuration, such as Nexus 6, then click '''Next'''. | # In the Select Hardware window, select a device configuration, such as Nexus 6, then click '''Next'''. | ||
Zeile 63: | Zeile 68: | ||
# Build the project from the command line. The output APK for the app module is located in<code>app/build/outputs/apk/</code>. | # Build the project from the command line. The output APK for the app module is located in<code>app/build/outputs/apk/</code>. | ||
# Make sure the Android SDK <code>platform-tools/</code> directory is included in your <code>PATH</code> environment variable. | # Make sure the Android SDK <code>platform-tools/</code> directory is included in your <code>PATH</code> environment variable. | ||
# Execute this command: | # Execute this command:</translate> | ||
#: <code>adb install app/build/outputs/MyFirstApp-debug.apk</code> | #: <code>adb install app/build/outputs/MyFirstApp-debug.apk</code> | ||
# On the emulator, locate ''MyFirstApp'' and open it. | # <translate>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 [[Spezial:MyLanguage/Android Training/Building a Simple User Interface|next lesson]]. | That's how you build and run your Android app on the emulator! To start developing, continue to the [[Spezial:MyLanguage/Android Training/Building a Simple User Interface|next lesson]]. | ||
</translate> | |||
{{TNT|Android Training/Attribution}} | {{TNT|Android Training/Attribution}} | ||
[[Kategorie:Android Training]] | [[Kategorie:Android Training]] |
Bearbeitungen