Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
NFC
Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to control NFC on a Cuttlefish device using the
Cuttlefish NFC feature. NFC is supported on Cuttlefish devices running
Android 15 or higher.
Use Casimir
The Cuttlefish NFC feature uses Casimir, an external NFC device simulation tool,
which supports injecting APDU bytes for host card emulation. Casimir is
implemented in
/platform/system/nfc/tools/casimir/
.
When launching Cuttlefish, Casimir is also launched by default. To
control Casimir, use the CasimirControlService
service.
CasimirControlService
You can use the CasimirControlService
service through the REST API or the
command line interface. For details, see
Cuttlefish: Environment Control.
The following table describes the method in CasimirControlService
. For
more information, see
casimir_control.proto
.
Method |
Description |
SendApdu
|
Sends APDU bytes (hex strings) with NFC-A and ISO-DEP.
The response is returned as hex strings. |
The following is an example command and a simplified response for sending two
APDU bytes, [0x00, 0x11, 0x22]
and [0x33, 0x44, 0x55]
.
Command
cvd env call CasimirControlService SendApdu '{apdu_hex_strings: ["001122", "334455"]}'
Simplified response
Rpc succeeded with OK status
{
"responseHexStrings": [
"9000",
"9000",
]
}
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-26 UTC."],[],[],null,["# NFC\n\nThis page describes how to control NFC on a Cuttlefish device using the\nCuttlefish NFC feature. NFC is supported on Cuttlefish devices running\nAndroid 15 or higher.\n\nUse Casimir\n-----------\n\nThe Cuttlefish NFC feature uses Casimir, an external NFC device simulation tool,\nwhich supports injecting APDU bytes for host card emulation. Casimir is\nimplemented in\n[`/platform/system/nfc/tools/casimir/`](https://cs.android.com/android/platform/superproject/+/android-latest-release:packages/modules/Nfc/libnfc-nci/tools/casimir/).\n\nWhen launching Cuttlefish, Casimir is also launched by default. To\ncontrol Casimir, use the `CasimirControlService` service.\n\n### CasimirControlService\n\nYou can use the `CasimirControlService` service through the REST API or the\ncommand line interface. For details, see\n[Cuttlefish: Environment Control](/docs/setup/create/cuttlefish-control-environment).\n\nThe following table describes the method in `CasimirControlService`. For\nmore information, see\n[`casimir_control.proto`](https://cs.android.com/android/platform/superproject/+/android-latest-release:device/google/cuttlefish/host/commands/casimir_control_server/casimir_control.proto).\n\n| Method | Description |\n|------------|-------------------------------------------------------------------------------------------------|\n| `SendApdu` | Sends APDU bytes (hex strings) with NFC-A and ISO-DEP. The response is returned as hex strings. |\n\nThe following is an example command and a simplified response for sending two\nAPDU bytes, `[0x00, 0x11, 0x22]` and `[0x33, 0x44, 0x55]`.\n\n- Command\n\n cvd env call CasimirControlService SendApdu '{apdu_hex_strings: [\"001122\", \"334455\"]}'\n\n- Simplified response\n\n Rpc succeeded with OK status\n {\n \"responseHexStrings\": [\n \"9000\",\n \"9000\",\n ]\n }"]]