Scripts Documentation
The Scripts feature allows you to create, import, and run JavaScript scripts to automate debugging tasks and JIT operations.
Overview
Scripts in StikDebug enable you to automate repetitive tasks, perform batch operations, and create custom workflows using JavaScript. This powerful feature extends StikDebug's capabilities beyond the built-in UI.
Getting Started
- Open StikDebug and navigate to the Scripts tab
- Create a new script or import an existing one
- Write or edit your JavaScript code
- Run the script to execute your automation
Creating Scripts
New Script
To create a new script:
- Tap the "+" or "New Script" button
- Enter a name for your script
- Write your JavaScript code in the editor
- Save the script
Script Editor
The script editor provides:
- Syntax highlighting for JavaScript
- Error checking and validation
- Auto-completion suggestions
- Line numbers for easy navigation
Importing Scripts
You can import scripts from various sources:
- Local Files: Import .js files from your device
- URLs: Download scripts from web URLs
- Shared Scripts: Import scripts shared by the community
- GitHub: Import scripts from GitHub repositories
Running Scripts
On-Demand Execution
Run scripts manually when needed:
- Select the script from your library
- Tap the "Run" button
- Monitor output in the console
- Review results
Scheduled Execution
Schedule scripts to run automatically:
- Set specific times for execution
- Create recurring schedules
- Run on device events
Script Library Management
Organize your scripts:
- Categories: Organize scripts into folders or categories
- Favorites: Mark frequently used scripts as favorites
- Search: Quickly find scripts by name or content
- Edit: Modify existing scripts
- Delete: Remove scripts you no longer need
- Share: Share scripts with the community
Script Examples
Basic JIT Enable Script
// Enable JIT for a specific app
function enableJIT(appBundleId) {
// Your JIT enabling code here
console.log("Enabling JIT for: " + appBundleId);
// ... implementation
}
enableJIT("com.example.app");
Batch Profile Management
// Check and manage multiple profiles
function checkProfiles() {
// Your profile checking code here
console.log("Checking profiles...");
// ... implementation
}
checkProfiles();
Best Practices
- Test First: Test scripts on non-critical apps first
- Error Handling: Include proper error handling in your scripts
- Comments: Add comments to explain complex logic
- Backup: Keep backups of important scripts
- Version Control: Use version numbers for script updates
- Documentation: Document what your scripts do
Sharing Scripts
Share your scripts with the community:
- Export scripts to shareable formats
- Share on GitHub or other platforms
- Contribute to the StikDebug script library
- Help others by sharing useful automation
Troubleshooting
Script Won't Run
- Check for syntax errors in the editor
- Verify all required permissions are granted
- Ensure device pairing is active
- Check console for error messages
Script Errors
- Review error messages in the console
- Check script syntax and logic
- Verify all variables and functions are defined
- Test script in smaller parts
Related Features
Learn More
Explore other features or visit our Support page for help with scripting.