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

~/.emulator_console_auth_token的来源、生成及重建方法问询

Hey there, let's break down your questions about the .emulator_console_auth_token file clearly:

1. What's the origin of the ~/.emulator_console_auth_token file?

This is an authentication token file generated by the Android Emulator tool (part of the official Android SDK). Its core purpose is to secure access to the Android Emulator Console—that's the command-line interface that lets you control emulator instances (like tweaking network settings, simulating incoming SMS, adjusting device sensors, etc.). The token acts as a security check, ensuring only authorized users can send commands to the console and prevent unintended or malicious control of your emulators.

2. What processes/operations create this file, and how to regenerate it if deleted?

Let's split this into two straightforward parts:

What creates the .emulator_console_auth_token file?

  • The most common trigger: When you launch your first Android Emulator instance (either through Android Studio's AVD Manager, or by running the emulator command directly in your terminal), the emulator process automatically generates this token file in your home directory.
  • It can also be recreated if you explicitly reset or initialize emulator console authentication, but the primary scenario is launching any emulator instance for the first time (or after deleting the existing token file).

Regenerating the file (official methods)

If you delete the file, you don't need to jump through hoops—here are the official, supported ways to get a new one:

  • Simplest method: Just launch any existing Android Virtual Device (AVD) you have set up. The emulator will immediately detect the missing token file and generate a brand new one in your home directory automatically.
  • Command-line approach: Run emulator -avd <your-AVD-name> (replace <your-AVD-name> with the actual name of your AVD, which you can list with emulator -list-avds). Starting the emulator this way will trigger token generation.
  • Alternative via adb: You can use the adb tool to trigger token generation indirectly. Run adb emu auth token—this will prompt the emulator to create a new token if it doesn't exist, and even output the token value to your terminal (the file will still be created in your home directory as expected).

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 09:01:49