User Tools

Site Tools


dev

This is an old revision of the document!


Developing & building for the head unit

How to set a machine up to build, sign, install and debug apps for the Aiways U5 head unit (Adayo i.MX6, Android 4.4.2). See Hardware & OS for the platform and Root / ADB for getting in.

What you need

  • Android Studio (any recent version) + the Android SDK. The unit is Android 4.4.2 (API 19), so set minSdkVersion 19 (compileSdk / targetSdk can be higher). The ABI

is armeabi-v7a — don't ship arm64/x86-only native libraries.

  • A JDK (the one bundled with Android Studio is fine).
  • adb (Android platform-tools) on your PATH.

ADB over Wi-Fi

The unit runs adb over TCP and has ro.adb.secure=0 (no key-auth prompt). On the home Wi-Fi it is at 192.168.1.203:5555.

adb connect 192.168.1.203:5555
adb devices        # -> 192.168.1.203:5555   device

If adb-over-TCP isn't up, enable it from a root shell on the unit: setprop service.adb.tcp.port 5555 then stop adbd; start adbd.

Signing — the one thing to know

Several of our apps declare sharedUserId=“android.uid.system” so they can bind the OEM services and use system permissions. That requires the APK to be signed with the platform key.

On this setup no signing config is needed: the build machine's ~/.android/debug.keystore is the AOSP platform test-key, so a plain debug build is already platform-signed. Build and install:

./gradlew :app:assembleDebug
adb -s 192.168.1.203:5555 install -r app/build/outputs/apk/debug/app-debug.apk

install -r replaces in place, and on a signature mismatch it fails safely (the old app stays), so it's safe to try. (On a machine whose debug key is NOT the platform key, an app with the system sharedUserId won't install — put the platform test-key at ~/.android/debug.keystore, or add an explicit signingConfig.)

Talking to the car from an app

Vehicle data and commands go through two OEM bound services (bind by Intent action + package — they are not in ServiceManager, so a shell service call can't reach them):

Service Bind (action / package) Interface Use
Canbus action.adayo.CANBUSSERVICE / com.adayo.canbus ICanbusService getInt/getFloat/getIntArray(key) to read, sendData(action,val) to command — the signal keys
CarManager action.adayo.CARSERVICE / com.adayo.carmanager ICarService audio / EQ, radio, mcu_writeDataToMcu (raw MCU frames)

Carry the AIDL interface, or call via a raw Binder transact(). Sketch (Canbus):

bindService(new Intent("action.adayo.CANBUSSERVICE").setPackage("com.adayo.canbus"),
            conn, BIND_AUTO_CREATE);
// in onServiceConnected:
ICanbusService s = ICanbusService.Stub.asInterface(binder);
int   soc = s.getInt(3457);     // pack-1 SoC %
float v   = s.getFloat(3455);   // pack-1 voltage V
s.sendData(103, 1);             // A/C ON  (⚠ actuates the car)

No-code CAN probing

To try keys without writing an app, the CarMqttBridge bridge has a built-in probe (it already binds ICanbusService) — read or command any key straight from adb. See CAN bus → Probing signals live.

dev.1786137672.txt.gz · Last modified: by 127.0.0.1