
How to Build a SIM Toolkit App with Java Card
Even as eSIM technology becomes more prevalent, SIM Toolkit still plays a vital role in mobile networks. It enables operators and developers to run applications directly on the SIM card, managing services such as mobile banking, roaming updates, and account menus. Whether you are a mobile operator or a system integrator, mastering this process will enable you to provide secure, user-friendly tools within the SIM card.
A Step-by-Step Guide to SIM Toolkit App Development
To achieve this, you need a solid, step-by-step development process. From setting up your environment to managing OTA deployments, each stage plays a critical role in building a secure, high-performing SIM Toolkit app. Skip one, and you’re likely to hit roadblocks that waste time and wreck the user experience. In the next sections, we’ll break down the key steps—from the first line of code to remote updates—so you can build confidently, avoid common pitfalls, and deliver an app that works.
| Tool / Software | Purpose | Recommended Use | Open Source / Commercial | Notes |
| Java Card Development Kit (JCDK) | Compile and build CAP files | Essential for all SIM development | Official / Free | Includes converter and simulator tools |
| Eclipse / IntelliJ | IDE for development | Writing and debugging Java Card apps | Free / Commercial | Good plugin support |
| GlobalPlatformPro | Manage applets and keys | Real-world card deployment simulation | Open Source | Command-line tool, active community |
| PySIM | SIM simulation and debugging | Early-stage development and testing | Open Source | Emulates various SIM profiles |
| JCIDE | Dedicated Java Card IDE | All-in-one development tool | Commercial | Beginner-friendly UI |
| TMC THC20 Java Card | High-performance physical card | Real-world testing and deployment | Commercial | Secure, OTA-ready, developer-friendly |
Step 1: Setting Up the Development Environment
Before writing any code, ensure your tools are ready. First, install the Java Card Development Kit (JCDK), which includes a CAP file converter and validator. To ensure a smooth workflow, use it with an IDE such as Eclipse or IntelliJ. You’ll also need an emulator or smart card reader to test your application. Tools such as GlobalPlatformPro or PySIM can help manage applets. They work well in a simulated Java Card environment, providing realistic test conditions. Be careful to follow the ETSI standard, use the specified Java Card APIs, and follow the SIM Application Toolkit (SAT) structure. Once you’re set up, test it with a basic Hello World applet. Confirm that it compiles, installs, and returns the expected responses.
Step 2: Designing the Applet Structure and Services
The SIM Toolkit applet contains proactive commands that prompt the device to perform actions. Your structure should be modular and event-driven. Each function responds to a trigger such as card insertion or menu selection. Using the SIM Java Card API, define the applet’s logic in the install() method. Then, use processToolkit() to respond to events. For example, to display a balance menu, use the ProactiveHandler and EnvelopeHandler classes to build and respond to UI flows.
The user experience is critical. The SIM menu UI has limited functionality, so keep it simple. Avoid complex, cluttered menus. Provide quick, relevant actions with minimal user effort, taking localization and user level into consideration.

Step 3: Handling Security and Access Permissions
Security isn’t optional—it’s the foundation. SIMs store critical data and talk directly to networks. Your app must never expose private information or allow unauthorized access to it. Declare permissions during installation using the SecurityDomain. Set strict access control for files, events, and channels. The SIM Java card offers security features such as firewalls and cryptographic APIs—utilize them all.
Test against common vulnerabilities, such as buffer overflows and bad TLV parsing. Also, validate all terminal responses. Never assume device behaviour—be sceptical. Sign applets with trusted certificates. Keep dev and prod keys separate. Never hardcode secrets—use secure storage or dynamic key management.
Step 4: Managing Communication with the Mobile Device
Proactive commands power SIM Toolkit interactions. These commands instruct phones on what to do, ranging from displaying text to sending SMS messages. How well you use them defines the user experience. Use DISPLAY_TEXT for messages, GET_INPUT for data, and SEND_SMS for backend contact. The ProactiveHandler class facilitates the easy construction of these flows on a SIM Java card.
Test how commands behave on different phones. OS and firmware differences cause odd bugs. Test across devices to ensure consistency. Build fallback plans. If a command fails or a phone lacks support, switch to a simpler backup to avoid crashes or dead ends. Track envelope events, such as EVENT_LOCATION_STATUS, to adapt on the fly. This helps your app respond to real-time changes and user behaviour.

Step 5: Data Storage and File Management
SIM cards utilize a GSM/3GPP file structure, comprising the Master File (MF), Dedicated Files (DF), and Elementary Files (EF). Your app may need to read, write, or update these data points effectively. Use the SIM Java card’s FileView API for secure file operations. Always check permissions first. Encrypt sensitive data and use secure channels.
Avoid frequent writes—SIMs have limited memory cycles. Cache data in RAM when possible, or shift storage to backend systems for improved performance. Clean up after yourself. Remove leftover files when uninstalling or upgrading your applet. This keeps the card efficient and ready for new services. Managing storage wisely boosts performance and ensures smooth future OTA operations.
Step 6: Testing and Debugging Your Applet
You can’t build a solid SIM Toolkit app without serious testing. Simulate different phones, networks, and edge cases. Start with a SIM Java card simulator before moving to a physical one. Test all events: cold boot, reset, eject, and menu use. See how your app responds to unusual scenarios, such as network drops, user spam-tapping, or low battery.
Analyse data exchanges using tools like APDUTool or SimSpy. These tools help diagnose bugs in TLV parsing or APDU logic. Run stress tests and simulate chaos. Your app should fail safely, not crash spectacularly. Don’t skip regression tests. One minor change can break everything. Keep test scripts versioned and current.

Step 7: Deploying and Updating Over-the-Air (OTA)
Your app is ready. It’s time to push it live via OTA—there’s no need to physically touch the SIM. For remote updates, use SMS-PP or HTTPS delivery. Sign and encrypt the applet per GlobalPlatform rules. Then, please send it via a Secure Channel Protocol session (SCP02 or SCP03 on a SIM Java card).
Add rollback support. If the update fails mid-air due to signal drops or battery loss, your app should stay intact, not half-installed and broken. Connect your backend to the provisioning engine. Monitor logs, success rates, and feedback in real-time. This will help you catch problems quickly and optimize rollout.OTA isn’t just file delivery—it’s a full security and feedback loop. Treat it like a core part of your dev cycle.
Final Thoughts on Building a Reliable SIM Toolkit App
Building a reliable SIM toolkit can generate significant benefits, whether you’re launching banking features or a telecommunications service; the SIM card is always an essential component. Choosing a Java card is crucial before building your SIM toolkit. I recommend the DCCO TMC THC20 SIM Java card. It’s a rugged, high-performance card designed for secure, scalable SIM toolkits. It can handle complex commands, supports OTA updates, and ensures your applications run smoothly in real-world deployments. This card is customizable and inexpensive; please contact us if you are interested.