---
schema_version: "1"
id: 55f23d5a64099c025e950b55179b7f9d010e7a5d475c4029fb5534a939024aa4
title: Debugging, Testing, and Deploying Apex
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_debug_test_deploy.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debug_test_deploy.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7c14de51e9e629daad8820c7338d383666d79d0da70035187e333a49628b13cf
description: Develop your Apex code in a sandbox and debug it with the Developer Console and debug logs. Unit-test your code, then distribute it to customers using packages.
---
# Debugging, Testing, and Deploying Apex

Develop your Apex code in a sandbox and debug it with the Developer Console and debug logs. Unit-test your code, then distribute it to customers using packages.

- **[Debugging Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging.htm)**  
    Apex provides debugging support. You can debug your Apex code using the Developer Console and debug logs.
- **[Testing Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing.htm)**  
    Apex provides a testing framework that allows you to write unit tests, run your tests, check test results, and have code coverage results.
- **[Deploying Apex](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_deploying.htm)**  
    You can't develop Apex in your Salesforce production org. Your development work is done in a sandbox, in a scratch org, or in a Developer Edition org.
- **[Apex in Managed Packages](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_manpkgs_behavior_intro.htm)**  
    Learn how to develop, distribute, and use managed Apex. Apex in managed packages can behave differently than Apex in unmanaged packages or Apex deployed directly to an org. Managed package developers and subscribers must understand these differences so that they can safely evolve their packages and integrations.