Originally published on php-apps.learnio.dev — part of the Using Native PHP course. View this lesson on the original site.
Exploring the native:jump Command for Mobile Testing
In this lesson, we will explore the native:jump command, which is essential for launching your application on a mobile device using a network connection. This command simplifies the process of testing your app on physical devices by generating a QR code that can be scanned to access your application directly.
Opening Concept
The native:jump command allows developers to quickly test their applications on mobile devices without the need for complicated setup. This is particularly useful for rapid development cycles and user testing.
Teaching Content
To use the native:jump command, you first need to ensure that your development server is running. You can initiate the command as follows:
php artisan native:jump
By default, this command will serve your application and generate a QR code. However, if you want to skip the serving step and just generate the QR code, you can use the --no-serve option:
php artisan native:jump --no-serve
This command will output a QR code in the terminal, which you can scan with your mobile device to access the application directly.
See it with a Command Diagram
flowchart TD
A[Start Development Server] --> B{Run native:jump}
B -->|No Serve Option| C[Generate QR Code]
B -->|Default| D[Serve App]
D --> C
C --> E[Scan QR Code on Mobile]
E --> F[Access Application]
Try it with runnable commands
- Start your development server:
php artisan serve - Run the
native:jumpcommand to generate a QR code:php artisan native:jump - Alternatively, run the command without serving:
php artisan native:jump --no-serve
If it goes wrong
If you encounter issues when running the native:jump command, ensure that your development server is correctly set up and running. If the QR code does not appear, double-check your network connection and any firewall settings that might block access.
Remember
The native:jump command is a powerful tool for mobile development, allowing for quick testing and iteration. Familiarise yourself with the options available to make the most of your development workflow.
From Using Native PHP — Environment setup and development workflow