Android Things自定义镜像缺失打包APK:NXP i.MX7D刷机后Launcher丢失
Hey there, let's walk through why your custom Launcher isn't showing up and the default one keeps launching on your i.MX7D. From what you described, there are a few key issues to fix:
1. Incorrect Packaging Structure (The Most Likely Culprit)
Directly compressing a random folder and uploading it to the Android Things Console won't work—you need to follow the exact system directory structure the console expects to merge your custom content into the base image.
For a system-level Launcher (which you'll want to replace the default one), your APK needs to live in either:
system/priv-app/YourLauncher/(for privileged system apps, recommended for Launchers)system/app/YourLauncher/(for regular system apps)
Each Launcher directory should contain your signed APK file. When you package this structure into a zip, the root of the zip should be the system folder (not a parent folder containing system). If you get this wrong, the console won't deploy your APK to the device's system partition during flashing.
2. Incomplete Launcher Intent Filter
Your Launcher won't be recognized as a valid home app without the full set of intent filters. Make sure your AndroidManifest.xml includes this exact block for your main activity:
<activity android:name=".YourMainLauncherActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
The HOME and DEFAULT categories are mandatory—without them, Android won't list your app as a Launcher option. If you want it to be the default automatically, you might also need to set the android:launchMode="singleTask" attribute on the activity, and ensure your APK is signed with the platform key (required for system apps on Android Things).
3. Boot Animation Configuration (Less Likely, But Worth Checking)
While a misconfigured boot animation probably isn't causing your Launcher to not install, it can disrupt the system startup flow if it's malformed. Here's what to verify:
- Your
bootanimation.zipmust be in thesystem/media/directory of your packaged zip. - The zip needs a valid
desc.txtfile defining the animation parameters, plus properly named frame images. - Permissions for
bootanimation.zipshould be set to644(read-only for all users) with ownerroot:root—the console usually handles this, but if you're manually building the structure, double-check.
4. Quick Troubleshooting Steps to Confirm
- Test the APK manually: Push your Launcher APK to the device via
adb install -r YourLauncher.apk. If it shows up as a Launcher option, the APK itself is valid—your packaging is the problem. - Check installed packages: Run
adb shell pm list packages | grep your.package.name. If nothing returns, your APK wasn't included in the flashed image—go back to fix your zip structure. - Inspect system logs: Use
adb logcat | grep your.package.nameto look for installation errors (like signature mismatches, missing permissions, or invalid directory paths).
Once you fix the packaging structure and intent filter, recompile your zip, upload it to the console, and flash the updated image—your custom Launcher should now install and be recognized as the default home app.
内容的提问来源于stack exchange,提问作者Mus

