You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Ubuntu 16.04中为Android Studio特定模拟器创建桌面启动器图标

Absolutely you can set up a dedicated launcher for your specific Android Studio emulator (like Nexus_4_API_27) on Ubuntu 16.04! I’ve done this dozens of times to skip the hassle of navigating through Android Studio’s AVD Manager every time—here’s exactly how to make it work:

Create a Custom Launcher for Nexus_4_API_27 Emulator on Ubuntu 16.04

Step 1: Confirm Your Emulator's Details & Launch Command

First, let’s lock in the exact info needed to launch your target emulator:

  • Open a terminal and run this command to list all your installed AVDs (Android Virtual Devices):
    emulator -list-avds
    
    You should see Nexus_4_API_27 in the output (if not, double-check your AVD Manager in Android Studio to ensure the emulator is properly set up).
  • Test the launch command to make sure it works:
    emulator -avd Nexus_4_API_27
    
    If the emulator fires up, perfect. If not, you’ll need to use the full path to the emulator executable (it’s usually in your Android SDK directory). For example:
    /home/your-username/Android/Sdk/emulator/emulator -avd Nexus_4_API_27
    
    Replace your-username with your actual Ubuntu username, and confirm this command launches the emulator successfully.

Step 2: Create the Desktop Launcher File

Ubuntu uses .desktop files for application launchers. We’ll create one in your user-specific folder so it only appears for your account:

  • Open a terminal and run this command to create a new launcher file:
    nano ~/.local/share/applications/nexus4-api27-emulator.desktop
    

Step 3: Fill in the Launcher Details

Paste the following content into the nano editor, then tweak the paths to match your system:

[Desktop Entry]
Type=Application
Name=Nexus 4 API 27 Emulator
Comment=Launch Nexus 4 emulator running Android API 27
Exec=/home/your-username/Android/Sdk/emulator/emulator -avd Nexus_4_API_27
Icon=/home/your-username/Android/Sdk/platforms/android-27/res/drawable-xxhdpi/ic_launcher.png
Terminal=false
Categories=Development;Android;Emulator;
  • Exec: Replace with the full working launch command you tested in Step 1.
  • Icon: Use any icon you prefer. The path above uses a default Android icon from the API 27 platform files, but you could also use the Android Studio icon (/home/your-username/android-studio/bin/studio.png) or a custom icon you download.
  • Save the file by pressing Ctrl+O, hit Enter, then exit nano with Ctrl+X.

Step 4: Make the Launcher Executable

Launcher files need execute permissions to function. Run this command:

chmod +x ~/.local/share/applications/nexus4-api27-emulator.desktop

Step 5: Test Your New Launcher

  • Open the Ubuntu Dash (click the top-left icon or press the Super key) and search for "Nexus 4 API 27 Emulator".
  • Click the icon—your emulator should launch directly, no need to open Android Studio first!

Troubleshooting Tips

  • If the launcher doesn’t show up, log out and log back in (Ubuntu sometimes needs a refresh to detect new .desktop files).
  • If the emulator fails to launch, double-check the Exec path in the .desktop file—typos here are the most common culprit.
  • For a system-wide launcher (visible to all users), create the file in /usr/share/applications/ instead of ~/.local/share/applications/, and run the commands with sudo.

内容的提问来源于stack exchange,提问作者Anjan Biswas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:25:16