Application Debugging Method and Related Devices
By introducing an adaptation layer to simulate the display and operation configuration of multi-end devices, the problems of low efficiency and high cost of multi-end application debugging are solved, and efficient and accurate application debugging effects are achieved.
Patent Information
- Application Number
- CN202011385080.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2040-11-30
AI Technical Summary
The existing application debugging methods are inefficient and costly on multi-end devices. There are hardware and operation differences in real machine debugging, and the simulator debugging effect is inaccurate or the resource occupies a large amount.
Add an adaptation layer between the system layer and the application layer of the electronic device, and determine the display area, theme and display direction configuration information of the target device type and theme through the adaptation layer, and simulate the application interface and operation of the multi-end device.
It realizes application debugging that simulates multi-end devices quickly and accurately on a single device, improves efficiency, reduces costs, and has a closer simulation effect to real devices.
Smart Images

Figure CN114579424B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of electronic devices, and in particular, to an application debugging method and related devices. Background Art
[0002] In application development, it is necessary to debug the interface of an application. One debugging method is to perform debugging on the corresponding terminal device. For example, an application developed for a mobile phone needs to be debugged on the mobile phone, and an application developed for a large screen needs to be debugged on the large screen. If it is a multi-terminal application (that is, an application that can run on different terminal devices, such as mobile phones, watches, and large screens), different debugging terminals (such as mobile phones, watches, large screens, etc.) need to be prepared, and the multi-terminal application needs to be debugged separately on different terminal devices. This application testing method not only has low debugging efficiency but also increases the debugging cost.
[0003] Another debugging method is to simulate a terminal device through a pure software (i.e., emulator) method. Simulating a terminal device through a pure software method includes the method of translating system APIs (Application Programming Interfaces) and the method of creating a virtual machine. The method of translating system APIs requires translating a large number of interfaces, and it is difficult to achieve 100% interface translation, which is likely to cause incomplete interface coverage or differences between the interface function implementation and the original function, resulting in differences between the debugging effect and the actual effect. The method of creating a virtual machine can achieve a better simulation effect, but running a virtual machine has relatively high configuration requirements for the debugging device (such as a computer), which increases the threshold of development and debugging and also increases the cost of development and debugging. Summary of the Invention
[0004] Embodiments of this application disclose an application debugging method and related devices, which can improve the debugging efficiency and debugging effect of an application and reduce the debugging cost.
[0005] A first aspect of this application discloses an application debugging method, which is applied to a first electronic device. The first electronic device includes a system layer, an adaptation layer, and an application layer, and the application layer includes an application to be debugged. The method includes:
[0006] The adaptation layer determines the display area configuration information, theme configuration information, and display direction configuration information corresponding to the target device type and the target device theme;
[0007] The adaptation layer sends the display area configuration information, theme configuration information, and display direction configuration information to the system layer;
[0008] The system layer determines the theme configuration information during the debugging of the application to be debugged;
[0009] The system layer renders the application interface of the application to be debugged according to the display area configuration information, the display orientation configuration information, the theme configuration information during the debugging of the application to be debugged, and the page layout information in the page description, and displays the application interface of the application to be debugged on the target device on the screen of the first electronic device. The page description is sent by the application to be debugged to the system layer during the startup phase, and the page description includes page layout information, which indicates the page elements included in the application interface and the positions of the page elements.
[0010] In this application, an adaptation layer is added between the system layer and the application layer of the first electronic device to enable the first electronic device to simulate other target devices, such as multi-terminal devices. This application effectively solves the problems of differences in hardware and operations between real devices and simulators, and at the same time solves the problems of large resource consumption of simulators and significant differences between physical operations and real operations. This application enables fast debugging on different target devices, improving the efficiency of application debugging. This application does not require the deployment of different terminal devices for application debugging, reducing the cost of application debugging. The first electronic device can have the hardware capabilities required by the application, enabling more accurate and realistic simulation of terminal devices and improving the effect of application debugging.
[0011] In some optional embodiments, before the adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme, the method further includes:
[0012] The adaptation layer receives the target device type and target device theme sent by the second electronic device;
[0013] The adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme, specifically:
[0014] The adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme according to the corresponding relationship between the device type, device theme, and display area configuration information, theme configuration information, and display orientation configuration information pre-stored in the first electronic device.
[0015] In some optional embodiments, before the adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme, the method further includes:
[0016] The adaptation layer receives the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme sent by the second electronic device.
[0017] The correspondence between device types, device themes, display area configuration information, theme configuration information, and display orientation configuration information can be pre-stored in the first electronic device. The adaptation layer looks up the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme according to the correspondence between device types, device themes, display area configuration information, theme configuration information, and display orientation configuration information. Alternatively, the correspondence between device types, device themes, display area configuration information, theme configuration information, and display orientation configuration information can be pre-stored in the second electronic device. After receiving the target device type and target device theme set by the user, the second electronic device looks up the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme according to the correspondence between device types, device themes, and display configuration information, and sends the display area configuration information, theme configuration information, display orientation configuration information, and operation configuration information corresponding to the target device type and target device theme to the first electronic device. The above two methods can obtain the display area configuration information, theme configuration information, and display orientation configuration information more flexibly.
[0018] In some alternative embodiments, the theme configuration information determined by the system layer during the debugging of the application to be debugged includes:
[0019] The system layer obtains the theme configuration information of the system layer, the theme configuration information of the adaptation layer, and the theme configuration information of the application layer, and determines the theme configuration information during the debugging of the application to be debugged in the order of decreasing priority from high to low of the application layer, the adaptation layer, and the system layer.
[0020] In some alternative embodiments, the system layer obtains the theme configuration information of the system layer, including:
[0021] The system layer obtains the theme configuration information of the system layer from the configuration information pre-set in the first electronic device;
[0022] The system layer obtains the theme configuration information of the adaptation layer, including:
[0023] The system layer sends a theme configuration request to the adaptation layer, and the theme configuration request is used to obtain the theme configuration information of the adaptation layer;
[0024] In response to receiving the theme configuration request, the adaptation layer sends a theme configuration response to the system layer. The theme configuration response carries the theme configuration information of the adaptation layer, and the theme configuration information of the adaptation layer is the theme configuration information determined by the adaptation layer corresponding to the target device type and target device theme;
[0025] In response to receiving the theme configuration response, the system layer obtains the theme configuration information of the adaptation layer from the theme configuration response;
[0026] The system layer obtains the theme configuration information of the application layer, including:
[0027] The page description also includes the theme configuration information of the application layer, and the system layer obtains the theme configuration information of the application layer from the page description.
[0028] In some alternative embodiments, the page description does not include the theme configuration information of the application layer, the theme configuration information of the application layer obtained by the system layer from the page description is empty, and the system layer determines the theme configuration information of the adaptation layer as the theme configuration information during the debugging of the application to be debugged.
[0029] In some alternative embodiments, the system layer determines the theme configuration information during the debugging of the application to be debugged, including:
[0030] If the page description also includes the theme configuration information of the application layer, the system layer obtains the theme configuration information of the application layer from the page description;
[0031] The system layer determines the theme configuration information of the application layer as the theme configuration information during the debugging of the application to be debugged;
[0032] Or, if the page description does not include the theme configuration information of the application layer, the system layer sends a theme configuration request to the adaptation layer, and the theme configuration request is used to obtain the theme configuration information of the adaptation layer;
[0033] In response to receiving the theme configuration request, the adaptation layer sends a theme configuration response to the system layer. If the theme configuration response carries the theme configuration information of the adaptation layer, the system layer determines the theme configuration information of the adaptation layer as the theme configuration information during the debugging of the application to be debugged;
[0034] Or, if the theme configuration response does not carry the theme configuration information of the adaptation layer, the pre-configured information of the first electronic device includes the theme configuration information of the system layer, and the system layer obtains the theme configuration information of the system layer from the pre-configured information of the first electronic device;
[0035] The system layer determines the theme configuration information of the system layer as the theme configuration information during the debugging of the application to be debugged.
[0036] In some alternative embodiments, the system layer renders the application interface of the application to be debugged according to the display area configuration information, the display orientation configuration information, the theme configuration information during the debugging of the application to be debugged, and the page layout information in the page description, including:
[0037] The system layer draws the display area of the target device on the screen of the first electronic device according to the display area configuration information and the display orientation configuration information;
[0038] The system layer performs layout and rendering on the display area according to the theme configuration information during the debugging of the application to be debugged and the page layout information in the page description.
[0039] In some alternative embodiments, before the adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and target device theme, the method further includes:
[0040] The application to be debugged sends page descriptions and event response information to the system layer during the startup phase, and the event response information includes the response manner of operation events;
[0041] The system layer determines the theme configuration information when the application to be debugged is started;
[0042] The system layer obtains the display area and display orientation of the first electronic device from the system hardware information of the first electronic device;
[0043] The system layer renders the application interface of the application to be debugged according to the theme configuration information, the display area and display orientation of the first electronic device, and the page layout information when the application to be debugged is started, and displays the application interface after the application to be debugged is started.
[0044] In some alternative embodiments, the system layer determining the theme configuration information when the application to be debugged is started includes:
[0045] The system layer obtains the theme configuration information of the system layer, the theme configuration information of the adaptation layer, and the theme configuration information of the application layer, and determines the theme configuration information when the application to be debugged is started in the order of decreasing priority of the application layer, the adaptation layer, and the system layer.
[0046] In some alternative embodiments, the method further includes:
[0047] The adaptation layer determines the operation configuration information corresponding to the target device type and target device theme, and the operation configuration information includes the mapping relationship between operation commands and operation events;
[0048] The adaptation layer sends the operation configuration information to the system layer;
[0049] The adaptation layer receives the operation command sent by the second electronic device, and the operation command is sent by the second electronic device in response to the first user operation, and the first user operation is used to indicate a specific operation on the target device for the application to be debugged;
[0050] The adaptation layer determines the operation event corresponding to the operation command according to the operation configuration information;
[0051] The adaptation layer sends the operation event to the system layer;
[0052] In response to receiving the operation event, the system layer performs corresponding processing according to the operation event and the event response information.
[0053] In some alternative embodiments, before the adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme, the method further includes:
[0054] The adaptation layer receives the target device type and the target device theme sent by the second electronic device;
[0055] The adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme, specifically:
[0056] The adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme according to the corresponding relationship between the device type, the device theme and the operation configuration information pre-stored in the first electronic device.
[0057] In some alternative embodiments, before the adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme, the method further includes:
[0058] The adaptation layer receives the operation configuration information corresponding to the target device type and the target device theme sent by the second electronic device.
[0059] In some alternative embodiments, the operation command includes any one or more of the following: a first operation command indicating a physical key operation on the target device, a second operation command indicating a virtual key operation on the target device, and a third operation command indicating a touch operation on the target device.
[0060] In some alternative embodiments, the application to be debugged includes a single-end application and a multi-end application.
[0061] A second aspect of the present invention discloses an application debugging method, which is applied to a second electronic device, and the method includes:
[0062] Receiving the target device type and the target device theme set by the user;
[0063] Sending the target device type and the target device theme to the first electronic device, so that the first electronic device debugs the application interface display of the application to be debugged on the target device.
[0064] In some alternative embodiments, receiving the target device type and the target device theme set by the user includes:
[0065] Displaying a first debugging interface, where the first debugging interface includes two setting items of "target device type" and "target device theme";
[0066] Receiving the target device type and the target device theme set by the user on the first debugging interface.
[0067] In some alternative embodiments, after sending the target device type and the target device theme to the first electronic device, the method further includes:
[0068] Receiving a first user operation for indicating a specific operation on the to-be-debugged application on the first electronic device on the target device;
[0069] Sending an operation command corresponding to a predetermined operation to the first electronic device, so that the first electronic device debugs the application operation of the to-be-debugged application on the target device.
[0070] A third aspect of the present invention discloses a computer-readable storage medium, including computer instructions, which, when running on an electronic device, cause the electronic device to execute the application debugging method as in the first aspect or the second aspect.
[0071] A fourth aspect of the present application discloses a first electronic device, which includes a processor and a memory. The memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the first electronic device executes the application debugging method as in the first aspect.
[0072] A fifth aspect of the present application discloses a second electronic device, which includes a processor and a memory. The memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the second electronic device executes the application debugging method as in the second aspect.
[0073] A sixth aspect of the present application discloses a chip system, which is applied to an electronic device; the chip system includes an interface circuit and a processor; the interface circuit and the processor are interconnected through a line; the interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor, and the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the chip system executes the application debugging method as in the first aspect or the second aspect.
[0074] It should be understood that the computer-readable storage medium in the third aspect, the first electronic device in the fourth aspect, the second electronic device in the fifth aspect, and the chip system in the sixth aspect provided above correspond to the methods in the first aspect and the second aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 is a schematic diagram of an application scenario of the application debugging method disclosed in an embodiment of the present application.
[0076] Figure 2 is an architecture diagram of the first electronic device disclosed in an embodiment of the present application.
[0077] Figure 3 It is a flowchart of the application debugging method disclosed in the embodiments of the present application.
[0078] Figure 4A 、 4B It is an effect diagram of simulating the display areas of a watch and a large screen on a mobile phone.
[0079] Figure 5A 、 5B It is an effect diagram of simulating the application interfaces of a watch and a large screen on a mobile phone.
[0080] Figure 6 It is a schematic diagram of simulating the rotation of the crown of a watch on a mobile phone.
[0081] Figure 7 It is a schematic structural diagram of the electronic device disclosed in the embodiments of the present application.
[0082] Figure 8 It is a schematic diagram of the corresponding relationship between device types, device themes, display configuration information, and operation configuration information.
[0083] Figure 9 It is a schematic diagram of the mapping relationship between operation commands and operation events. Detailed implementation manners
[0084] To better understand the application debugging method and related devices disclosed in the embodiments of the present application, the application scenarios of the application debugging method of the present application will be described first below.
[0085] Figure 1 It is a schematic diagram of the application scenario of the application debugging method disclosed in the embodiments of the present application. As Figure 1 shown, the physical devices required for the application debugging method include a first electronic device 10 and a second electronic device 11. The first electronic device 10 includes an application to be debugged (i.e., the application to be debugged) 100. The second electronic device 11 includes a debugging tool 110, such as an Android Debug Bridge (ADB). The second electronic device 11 sends a debugging instruction to the first electronic device 10 through the debugging tool 110. The first electronic device 10 simulates the operation of the application 100 on a target device (such as a mobile phone, a watch, a large screen, or a car machine) in response to the debugging instruction. According to the result of the first electronic device 10 simulating the operation of the application 100 on the target device, it can be determined whether the application interface display and application operations of the application 100 on the target device are normal, thereby realizing the debugging of the application 100.
[0086] The application 100 can be any application that can run on the first electronic device 10, such as a tool application, a social chat application, a news application, etc.
[0087] The first electronic device 10 has the hardware capabilities required by the application 100, such as Wi-Fi (Wireless Fidelity) capabilities, cellular data capabilities, and touch capabilities.
[0088] In one embodiment of the present application, the application 100 can be a multi-terminal application, that is, an application that can run on different terminal devices (such as mobile phones, watches, large screens, etc.). For example, the application 100 can be a calendar, clock, weather, music player, etc. On different terminal devices, the user interfaces of the multi-terminal application can be different.
[0089] It should be understood that the application 100 can also be a single-terminal application, that is, an application that runs on a single terminal device (such as a mobile phone, watch, or large screen).
[0090] The second electronic device 11 can be a personal computer. The first electronic device 10 can be a mobile phone, tablet computer, large screen, etc.
[0091] The second electronic device 11 and the first electronic device 10 can be connected in a wired manner, for example, connected via USB (Universal Serial Bus). The second electronic device 11 and the first electronic device 10 can also be connected in a wireless manner, for example, connected via Bluetooth, Wi-Fi, NFC (Near Field Communication), ZigBee technology, IrDA technology (Infrared Data Association), UWB technology (ultra wideband), wireless USB (Universal Serial Bus), etc.
[0092] Figure 2 It is the architecture diagram of the first electronic device disclosed in the embodiment of the present application.
[0093] The first electronic device includes a system layer (OS layer), an adaptation layer, and an application layer (APP layer) from bottom to top. The application layer includes the application to be debugged.
[0094] The system layer provides image drawing capabilities and event handling capabilities. The image drawing capabilities are used to display image effects on the screen, and the event handling capabilities are used to implement user interactions (such as clicks, swipes, rotations, etc.). The configuration information of the first electronic device can be preset in the system layer, and the preset configuration information can include theme configuration information. The configuration information of the first electronic device (such as theme configuration information) can be preset according to the device type when the first electronic device leaves the factory. For example, when the first electronic device is a mobile phone, the preset theme configuration information of the first electronic device is the configuration information corresponding to the mobile phone.
[0095] The adaptation layer is used to configure the display area, theme, display direction, and operations of the application. The configuration of the display area, theme, and display direction can be collectively referred to as display configuration. After receiving the target device type and target device theme from the second electronic device, the adaptation layer can perform display configuration on the application, obtain the display area configuration information, theme configuration information, and display direction configuration information corresponding to the target device type and target device theme (the display area configuration information, theme configuration information, and display direction configuration information can be collectively referred to as display configuration information), and provide it to the system layer to achieve the display effect of the application under the target device type and target device theme. After receiving the target device type and target device theme from the second electronic device, the adaptation layer can also perform operation configuration on the application, obtain the operation configuration information corresponding to the target device type and target device theme, and after receiving the operation command from the second electronic device, obtain the operation event corresponding to the operation command and send it to the system layer to achieve the user interaction of the application.
[0096] The application layer provides the page description and event response information of the application for the system layer. The page description includes page layout information, which is used to notify the system layer of the graphics and positions drawn on the screen. For example, it notifies the system layer to draw a rectangle with a size of 100 x 100 starting from (100.0, 100.0) of the screen. The event response information is used to notify the system layer of the response method for operation events. For example, when a certain button is clicked, it notifies the system layer to pop up a prompt box.
[0097] Figure 3 It is a flowchart of the application debugging method disclosed in the embodiments of the present application.
[0098] The user starts the application on the first electronic device. For example, the user starts the music player on the mobile phone. The user can click the application icon on the first electronic device to start the application.
[0099] 301. In the startup stage of the application on the first electronic device, the application layer of the first electronic device sends the page description and event response information to the system layer of the first electronic device.
[0100] The startup stage of the application can be understood as the process from the user clicking the application to the display of the main page of the application.
[0101] The page description may include page layout information, such as the layout information of page elements including windows, scroll bars, buttons, etc. The page layout information indicates the page elements included in the page and their positions.
[0102] The page description may include theme configuration information or may not include theme configuration information.
[0103] The theme configuration information is used to represent the theme of an application. The theme refers to the overall style of the application, including colors, sizes, shapes, shadows, etc. Different target devices can have different themes, corresponding to different theme configuration information, to present different display effects. For example, a watch can have a watch theme, and a large screen can have a large screen theme, corresponding to different theme configuration information to achieve different application interfaces. For example, a button of an application is white and square on a watch and black and round on a large screen.
[0104] The same target device can have different themes, corresponding to different theme configuration information. For example, multiple themes can be set for a mobile phone, such as themes including Chinese style, night sky, simple white, etc., and each theme has corresponding theme configuration information.
[0105] The event response information defines the response method for operation events, such as the response method for operation events of page elements such as windows, scroll bars, buttons, etc. on a page (such as pressing a button).
[0106] 302. The system layer of the first electronic device determines the theme configuration information when the application is started.
[0107] In an embodiment of the present application, the system layer can determine the theme configuration information when the application is started in two ways.
[0108] Method 1: Obtain the theme configuration information of the system layer, the theme configuration information of the adaptation layer, and the theme configuration information of the application layer (which can be obtained in any order), and determine the theme configuration information when the application is started in the order of decreasing priority from the application layer, the adaptation layer, and the system layer.
[0109] Specifically, the system layer can obtain the theme configuration information of the system layer from the configuration information preset in the first electronic device;
[0110] The system layer can send a theme configuration request to the adaptation layer, receive the theme configuration response returned by the adaptation layer in response to the theme configuration request, and if the theme configuration response includes theme configuration information, obtain the theme configuration information of the adaptation layer from the theme configuration response;
[0111] If the page description sent by the application layer includes theme configuration information, obtain the theme configuration information of the application layer from the page description;
[0112] Among them, the theme configuration information obtained from the configuration information preset in the first electronic device is the theme configuration information of the system layer, the theme configuration information obtained from the theme configuration response is the theme configuration information of the adaptation layer, and the theme configuration information obtained from the page description is the theme configuration information of the application layer.
[0113] Then, the system layer can determine the theme configuration information at the time of application startup according to the source of the obtained theme configuration information, in the priority order of application layer > adaptation layer > system layer.
[0114] If the theme configuration response does not include theme configuration information, the theme configuration information of the adaptation layer obtained from the theme configuration response is empty.
[0115] If the page description sent by the application layer does not include theme configuration information, the theme configuration information of the application layer obtained from the page description is empty.
[0116] In a possible implementation, the theme configuration response returned by the adaptation layer may also not include theme configuration information, then the system layer will not obtain the theme configuration information of the adaptation layer.
[0117] Exemplarily, the theme configuration request sent by the system layer to the adaptation layer may carry the device type or may not carry the device type. Among them, the system layer can read the system hardware information and obtain the device type from the system hardware information. If the theme configuration request sent by the system layer to the adaptation layer carries the device type, the adaptation layer can determine the theme configuration information in the theme configuration response according to the device type carried in the theme configuration request. If the theme configuration request sent by the system layer to the adaptation layer does not carry the device type, the adaptation layer may not carry the theme configuration information in the theme configuration response, or may carry all the theme configuration information corresponding to the device types in the theme configuration response.
[0118] Method 2: In the order of decreasing priority of the application layer, adaptation layer, and system layer, first obtain the theme configuration information from the application layer with the highest priority. Once the theme configuration information is obtained, the obtained theme configuration information is determined as the theme configuration information at the time of application startup, avoiding continued acquisition of invalid theme configuration information and improving the efficiency of determining the actual theme configuration information.
[0119] Specifically, the system layer determines whether the page description sent by the application layer includes theme configuration information. If the page description sent by the application layer includes theme configuration information, obtain the theme configuration information from the page description sent by the application layer, and use the theme configuration information obtained from the page description as the theme configuration information at the time of application startup;
[0120] If the page description sent by the application layer does not include theme configuration information, send a theme configuration request to the adaptation layer, receive the theme configuration response returned by the adaptation layer in response to the theme configuration request. If the theme configuration response returned by the adaptation layer includes theme configuration information, obtain the theme configuration information from the theme configuration response, and use the theme configuration information obtained from the theme configuration response as the theme configuration information at the time of application startup;
[0121] If the page description sent by the application layer does not include theme configuration information, and the theme configuration response returned by the adaptation layer does not include theme configuration information, obtain the theme configuration information preset in the first electronic device from the system layer, and use the theme configuration information obtained from the system layer as the theme configuration information when the application is started.
[0122] 303. The system layer of the first electronic device obtains the display area and display direction of the first electronic device from the system hardware information of the first electronic device, and renders the application interface of the application according to the theme configuration information when the application is started, the display area and display direction of the first electronic device, and the page layout information in the page description, and displays the application interface after the application is started (i.e., the main page).
[0123] For example, the first electronic device is a mobile phone, and the application to be debugged is a music player. The system layer of the first electronic device obtains the display area (i.e., the screen size) and display direction (i.e., landscape or portrait) of the mobile phone from the system hardware information. The system layer of the first electronic device renders the application interface according to the theme configuration information when the music player is started, the display area of the mobile phone, the display direction, and the page layout information in the page description, and displays the application interface after the music player is started.
[0124] After the first electronic device starts the application and displays the application interface, it enters the debugging stage of the application. The user sets the target device type and target device theme on the second electronic device to confirm whether the application interface on the target device is normal. For example, the user sets the target device type to a mobile phone and sets the target device theme to night sky.
[0125] In an embodiment of the present application, the second electronic device may display a first debugging interface, and the user sets the target device type and target device theme on the first debugging interface.
[0126] The first debugging interface may include two setting items, "target device type" and "target device theme", and the first debugging interface may further include a "complete" button. The user can set the target device type and target device theme on the first debugging interface and press the "complete" button.
[0127] In another embodiment of the present application, each application has only one theme, and the user only needs to set the target device type on the second electronic device. For example, the first debugging interface includes one setting item, "target device type", and the user sets the target device type on the first debugging interface.
[0128] 304. After the user sets the target device type and target device theme, the second electronic device sends the target device type and target device theme to the first electronic device through the debugging tool.
[0129] In one embodiment of the present application, the second electronic device may detect user operations on the first debugging interface. When it detects that the user has set the target device type, target device theme on the first debugging interface and presses the "Finish" button, the second electronic device generates a first debugging instruction according to the target device type and target device theme set by the user through a debugging tool (such as ADB), and sends the first debugging instruction carrying the target device type and target device theme to the first electronic device.
[0130] In another embodiment of the present application, each application has only one theme, and the second electronic device sends the target device type set by the user to the first electronic device through a debugging tool. For example, when it detects that the user has set the target device type on the first debugging interface, the second electronic device generates a first debugging instruction according to the target device type set by the user through the debugging tool, and sends the first debugging instruction carrying the target device type to the first electronic device.
[0131] 305, the adaptation layer of the first electronic device receives the target device type and target device theme, and obtains the display configuration information (i.e., display area configuration information, theme configuration information, display orientation configuration information) and operation configuration information corresponding to the target device type and target device theme.
[0132] In one embodiment of the present application, the adaptation layer of the first electronic device receives the first debugging instruction, obtains the target device type and target device theme from the received first debugging instruction, and obtains the display area configuration information, theme configuration information, display orientation configuration information and operation configuration information corresponding to the target device type and target device theme.
[0133] The display area configuration information is used to simulate the display area of the target device.
[0134] A target device may have one or more themes, and each theme has corresponding theme configuration information. When a target device corresponds to one theme, the theme configuration information of the target device can be directly determined according to the target device type, or the theme configuration information of the target device can be determined according to the target device theme. When each target device corresponds to multiple themes, the theme configuration information of the target device can be determined according to the target device type and target device theme, or the theme configuration information of the target device can be determined according to the target device theme.
[0135] The display orientation configuration information is used to simulate the display orientation of the application on the target device, such as horizontal display (i.e., landscape screen) or vertical display (i.e., portrait screen).
[0136] The operation configuration information is used to simulate operations on a target device through predefined operations on a second electronic device. For example, to simulate a watch on a first electronic device, pressing ctrl+y (i.e., pressing the Ctrl key and the y key simultaneously) on the keyboard of the second electronic device is used to simulate rotating the crown of the watch. Another example is to simulate a large screen on the first electronic device, and pressing the up and down keys on the keyboard of the second electronic device is used to simulate pressing the up and down keys of the large screen. Different operations on the target device can correspond to different functions. For example, swiping up and down on the application interface can achieve page scrolling, and pressing the up and down keys of the target device can achieve volume adjustment. The operation configuration information can include the correspondence between operation commands and operation events. The operation command represents a predefined operation on the second electronic device, and the operation event represents an operation on the target device.
[0137] In an embodiment of the present application, the operation configuration information is used to simulate physical button operations on a target device. For example, assuming the target device type is a watch, the physical button operations corresponding to the watch include rotating, single-clicking, double-clicking, and long-pressing the crown of the watch. Another example is assuming the target device type is a large screen, the physical button operations corresponding to the large screen include pressing the up direction key, down direction key, left direction key, right direction key, home key, back key, and confirmation key of the large screen.
[0138] In an embodiment of the present application, the correspondence between device type, device theme, and display configuration information (i.e., display area configuration information, theme configuration information, display direction configuration information), and operation configuration information can be pre-stored in the first electronic device. The adaptation layer of the first electronic device searches for the display area configuration information, theme configuration information, display direction configuration information, and operation configuration information corresponding to the target device type and target device theme according to the correspondence between device type, device theme, and display area configuration information, theme configuration information, display direction configuration information, and operation configuration information.
[0139] Figure 8 It is a schematic diagram of the correspondence between device type, device theme, and display configuration information (including display area configuration information, theme configuration information, display direction configuration information), and operation configuration information. Refer to Figure 8 As shown, the watch has two device themes, A (e.g., daytime) and B (e.g., nighttime), and the large screen has two device themes, C (e.g., blue sky) and D (e.g., light and shadow). The A theme of the watch corresponds to display configuration information D1 and operation configuration information O1, the B theme of the watch corresponds to display configuration information D2 and operation configuration information O2, the C theme of the large screen corresponds to display configuration information D3 and operation configuration information O3, and the C theme of the large screen corresponds to display configuration information D4 and operation configuration information O4. The display configuration information D1, D2, D3, D4, and the operation configuration information O1, O2, O3, O4 can be defined according to actual needs.
[0140] In another embodiment of the present application, the correspondence between the device type, device theme, and display area configuration information, theme configuration information, display direction configuration information, and operation configuration information may be pre-stored in the second electronic device. After receiving the target device type and target device theme set by the user, the second electronic device searches for the corresponding display area configuration information, theme configuration information, display direction configuration information, and operation configuration information of the target device type and target device theme according to the correspondence between the device type, device theme, and display configuration information and operation configuration information, and sends the corresponding display area configuration information, theme configuration information, display direction configuration information, and operation configuration information of the target device type and target device theme to the first electronic device. In this way, the first electronic device can directly obtain the corresponding display area configuration information, theme configuration information, display direction configuration information, and operation configuration information of the target device type and target device theme from the second electronic device, without the first electronic device itself searching for the corresponding display area configuration information, theme configuration information, display direction configuration information, and operation configuration information of the target device type and target device theme and sending them to the first electronic device.
[0141] 306. The adaptation layer of the first electronic device sends the display configuration information (i.e., display area configuration information, theme configuration information, display direction configuration information) and operation configuration information corresponding to the target device type and target device theme to the system layer of the first electronic device.
[0142] 307. The system layer of the first electronic device determines the theme configuration information during application debugging according to the theme configuration information sent by the adaptation layer.
[0143] Determining the theme configuration information during application debugging is similar to determining the theme configuration information when the application starts (see 302). When determining the theme configuration information during application debugging, the theme configuration information of the adaptation layer is obtained in 306, that is, the theme configuration information of the adaptation layer is the theme configuration information sent by the adaptation layer to the system layer.
[0144] Specifically, the system layer can obtain the theme configuration information of the system layer and the application layer, and determine the theme configuration information during application debugging in the order of decreasing priority from the application layer, adaptation layer, and system layer. When determining the theme configuration information during application debugging, the system layer can directly use the theme configuration information of the system layer and the application layer obtained when determining the application start.
[0145] Alternatively, the system layer may, in the order of decreasing priority of the application layer, the adaptation layer, and the system layer, first obtain the theme configuration information from the application layer with the highest priority. Once the theme configuration information is obtained, the obtained theme configuration information is determined as the theme configuration information during application debugging. Since the theme configuration information of the adaptation layer has been obtained in 306, if the page description sent by the application layer includes the theme configuration information, the theme configuration information obtained from the page description is used as the theme configuration information during application debugging; if the page description sent by the application layer does not include the theme configuration information, the theme configuration information of the adaptation layer obtained in 306 is used as the theme configuration information during application debugging.
[0146] When obtaining the theme configuration information of the adaptation layer, the system layer may send a theme configuration request to the adaptation layer. In response to receiving the theme configuration request, the adaptation layer sends a theme configuration response to the system layer. The theme configuration response carries the theme configuration information of the adaptation layer, and the theme configuration information of the adaptation layer is the theme configuration information determined by the adaptation layer corresponding to the target device type and the target device theme. In response to receiving the theme configuration response, the system layer obtains the theme configuration information of the adaptation layer from the theme configuration response.
[0147] 308. The system layer of the first electronic device renders the application interface according to the display area configuration information, the display orientation configuration information, the theme configuration information during application debugging, and the page layout information in the page description, and simulates and displays the application interface of the application on the target device on the screen of the first electronic device.
[0148] First, the system layer draws the display area of the target device on the screen of the first electronic device according to the display area configuration information and the display orientation configuration information. Subsequent layout and drawing of the application will be performed on this display area. For example, if the target device type is a watch and the display area configuration information indicates that the display area of the watch is circular, the center and radius of the circle are:
[0149] .
[0150] The display orientation configuration information indicates that the display orientation is landscape or portrait.
[0151] The system layer may, according to the display area configuration information and the display orientation configuration information of the watch, add a circular area on the first electronic device (watch) as the display area of the watch.
[0152] For another example, assuming the target device type is a large screen, the drawing of the display area of the large screen may be to add a rectangular area with a preset aspect ratio (such as 16:9) horizontally on the first electronic device as the display area of the large screen.
[0153] Reference Figure 4A 、4B As shown, it is an effect diagram of simulating the display areas of a watch and a large screen on a mobile phone (the first electronic device).
[0154] The display area configuration information can specify that the display area of the target device is of a fixed size, and the system layer draws the display area of the target device of the fixed size on the first electronic device according to the display area configuration information. For example, the display area configuration information specifies that the display area of the target device is a circle with a diameter of 1000 pixels. Correspondingly, the system layer draws a circular display area with a diameter of 1000 pixels on the first electronic device.
[0155] The display area configuration information can also not specify that the display area of the target device is of a fixed size, and the system layer draws the display area of the target device of a non-fixed size on the first electronic device according to the display area configuration information. For example, the display area configuration information specifies that the display area of the target device is a rectangle with an aspect ratio of 16:9. Correspondingly, the system layer draws a rectangular display area of the target device with an aspect ratio of 16:9 that automatically adapts to the screen size of the first electronic device on the first electronic device according to the display area configuration information.
[0156] The display area of the target device can be drawn at a predetermined position on the screen of the first electronic device. For example, the center of the screen can be used as the center of the display area of the target device to draw the display area of the target device.
[0157] After the display area of the target device is drawn on the first electronic device, the system layer of the first electronic device performs layout and rendering on the display area of the target device according to the theme configuration information during application debugging and the page layout information in the page description, and obtains the application interface of the target device simulated on the first electronic device. The page layout information indicates the page elements and positions included in the page of the application. For example, the page layout information defines a button: <button style="width:100px; height: 100px;">< / button> ... The theme configuration information indicates the overall style of the application, including color, size, shape, shadow, etc. According to the theme configuration information during application debugging and the page layout information in the page description, the system layer generates the page of the application.
[0158] Taking a watch as an example, if the target device type is a watch, the adaptation layer of the first electronic device will notify the system layer to draw a circular area (such as a circle with a diameter of 1000 pixels) on the screen of the first electronic device, and distinguish it from other areas by filling colors or coloring the outline. For example, the circular area is light black and other areas are white, and the circular area is the dial area where the application interface is drawn. After the circular area is drawn, the system layer of the first electronic device performs layout and rendering on the circular area. Since the target device type is a watch, the system layer will obtain the theme of the watch. At this time, the style displayed on the mobile phone is the style of the watch.
[0159] If the target device type is a large screen, the adaptation of the first electronic device will notify the system layer to draw a rectangular area with a preset aspect ratio (such as 16:9) on the screen of the first electronic device in landscape mode. After the rectangular area is drawn, the system layer of the first electronic device performs layout and rendering on the rectangular area. Since the target device type obtained by the system layer from the adaptation layer is a large screen, it will obtain the theme of the large screen. At this time, the style displayed on the mobile phone is the style of the large screen.
[0160] Figure 5A 、 5B are the renderings of simulating the application interfaces of the watch and the large screen on the mobile phone.
[0161] To confirm whether the application operations on the target device are normal, the user performs a predetermined operation on the second electronic device, and the predetermined operation is used to indicate a specific operation on the application on the target device. For example, the user presses ctrl+y on the keyboard of the second electronic device to indicate rotating the crown of the watch.
[0162] The predetermined operation can be a mouse or keyboard operation on the second electronic device, such as pressing ctrl+y on the keyboard of the second electronic device or scrolling the mouse wheel.
[0163] Alternatively, the second electronic device can generate a second debugging interface, and the second debugging interface includes operation buttons (such as a "rotate crown" button, an "OK" button), and the predetermined operation can be an operation on the second debugging interface, such as clicking the "rotate crown" button.
[0164] 309, the second electronic device sends the operation command corresponding to the predetermined operation to the first electronic device.
[0165] The second electronic device detects whether the user performs a predetermined operation on the second electronic device. If it detects that the user performs a predetermined operation on the second electronic device, it generates an operation command through the debugging tool and sends the generated operation command to the first electronic device. For example, after the user presses ctrl+y on the keyboard of the second electronic device, the second electronic device generates an operation command (such as an ADB operation command) according to the ctrl+y key operation and sends the generated operation command to the adaptation layer of the first electronic device.
[0166] The operation command may include a first operation command indicating a physical button operation on the target device. For example, the ctrl+y button operation of the second electronic device may indicate rotating the crown of the watch. If the ctrl+y button operation is received, the second electronic device generates a first operation command indicating rotating the crown of the watch and sends the first operation command indicating rotating the crown of the watch to the first electronic device. Another example is that the enter key operation of the second electronic device may indicate pressing the confirmation key on the large screen. If the enter key operation is received, the second electronic device generates a first operation command indicating pressing the confirmation key on the large screen and sends the first operation command indicating pressing the confirmation key on the large screen to the first electronic device.
[0167] The operation command may also include a second operation command indicating a virtual button operation on the target device. For example, the enter key operation of the second electronic device may indicate pressing the virtual confirmation key of the watch (i.e., the confirmation key on the application interface). If the enter key operation is received, the second electronic device generates a predetermined operation command indicating the button operation of pressing the virtual confirmation key of the watch and sends the predetermined operation command indicating pressing the virtual confirmation key of the watch to the first electronic device.
[0168] The operation command may also include a third operation command indicating a touch operation on the target device. The touch operation refers to an operation other than a virtual button. For example, the scrolling operation of the mouse wheel on the second electronic device may indicate sliding up and down on the large screen. If the scrolling operation of the mouse wheel is received, the second electronic device generates a third operation command indicating sliding up and down on the large screen and sends the third operation command indicating sliding up and down on the large screen to the first electronic device.
[0169] The second electronic device may determine whether the received predetermined operation (such as a mouse or keyboard operation) is a preset operation. If the received predetermined operation is a preset operation, it generates an operation command and sends the generated operation command to the adaptation layer of the first electronic device. Otherwise, if the received predetermined operation is not a predefined keyboard or mouse operation, it does not respond to the predetermined operation.
[0170] 310. The adaptation layer of the first electronic device determines the operation event corresponding to the operation command according to the operation configuration information and sends the operation event to the system layer of the first electronic device.
[0171] The operation configuration information may include the mapping relationship between the operation command and the operation event. According to this mapping relationship, the operation event corresponding to the operation command can be determined.
[0172] See Figure 9As shown, it is a schematic diagram of the mapping relationship between operation commands and operation events. For example, the operation event corresponding to the operation command ctrl+y is the crown rotation event, the operation event corresponding to the operation command ctrl+t is the crown click event, the operation event corresponding to the operation command ctrl+b is the back event, and the operation events corresponding to the operation commands ctrl+left / right / up / down are the left / right / up / down direction events. If the operation command received from the second electronic device is ctrl+y, it is determined that the corresponding operation event is the crown rotation event.
[0173] The system layer has the event processing ability. After the adaptation layer determines the operation event corresponding to the operation command according to the operation configuration information, the system layer can process the operation event, thereby realizing the user interaction of the application.
[0174] For example, the adaptation layer encapsulates the operation command of pressing ctrl+y as the crown rotation event according to the operation configuration information, and sends the crown rotation event to the system layer so that the application can respond to the crown selection.
[0175] 311. The system layer of the first electronic device performs corresponding processing according to the operation event and the event response information.
[0176] The system layer can determine the response method corresponding to the operation event according to the event response information, and perform corresponding processing according to the response method.
[0177] For example, after receiving the crown rotation event, the system layer performs the operation of rotating the crown, thereby realizing the effect of simulating the crown rotation of a watch on the first electronic device.
[0178] The crown rotation event can be used to slide the page. For example, rotating the crown upward means sliding the page upward, and rotating the crown downward means sliding the page downward. Figure 6 It is a schematic diagram of simulating the crown rotation of a watch on a mobile phone.
[0179] If the application layer sets an event callback (representing the relevant processing logic of the action), the system layer will also call back to the application layer. For example, the application layer sets a click event callback for a button to pop up a message prompt box after the button is clicked. When the button is clicked, the system layer will trigger the event callback set by the application layer. After calling the callback of the application layer, the application layer will then call the interface of the system layer for drawing the prompt box, and the system layer will draw a message prompt box on the basis of the original page.
[0180] Existing application debugging methods all have certain deficiencies. For example, connecting to a real terminal device for application debugging has low efficiency. The method of pure software (simulator) simulation either has a deviation between the debugging effect and the real effect (the method of translating system APIs), or has a high debugging cost (the method of creating a virtual machine). The method of pure software simulation cannot well simulate the hardware capabilities of real devices, such as the WiFi capability and cellular network capability required in mobile application development and debugging.
[0181] In this application, an adaptation layer is added between the system layer and the application layer of the first electronic device to implement using the first electronic device to simulate other target devices, such as simulating multi-terminal devices. This application effectively solves the problems of differences in hardware and operations between real machines and simulators, and at the same time solves the problems of large resource occupation by the simulator and large differences between physical operations and real operations. This application realizes fast debugging on different target devices and improves the efficiency of application debugging. This application does not require deploying different terminal devices for application debugging, reducing the cost of application debugging. The first electronic device can have the hardware capabilities required by the application, and can more accurately and realistically simulate the terminal device, improving the effect of application debugging.
[0182] Figure 3 In the illustrated embodiment, 301-303 is the startup stage of the application, 304-308 is the debugging stage of the application interface, and 309-311 is the debugging stage of the application operation. It should be understood that the existing startup method can be used in the startup stage of the application. In addition, the application debugging method of this application can only debug the application interface without debugging the application operation. Debugging the application operation is a more comprehensive application debugging solution.
[0183] Figure 3 In the illustrated embodiment, while obtaining the display area configuration information, theme configuration information, and display direction configuration information corresponding to the target device type and target device theme, the adaptation layer obtains the operation configuration information corresponding to the target device type and target device theme, and while sending the display area configuration information, theme configuration information, and display direction configuration information to the system layer, sends the operation configuration information to the system layer. It should be understood that in other embodiments of this application, after the application interface debugging is completed, in the application operation debugging stage, the operation configuration information corresponding to the target device type and target device theme can be obtained, and the operation configuration information can be sent to the system layer.
[0184] In other embodiments, the method further includes:
[0185] The application layer receives user operations on the application interface;
[0186] The system layer processes the user operations on the application interface.
[0187] For example, when the user clicks a button (such as a play button) on the application interface, the application layer receives the button click operation and performs relevant processing according to the button click operation (such as playing music). The user can directly perform debugging operations on the application interface of the first electronic device to verify whether the functions of the application are normal. Debugging the application through operations on the application interface can refer to the prior art and will not be elaborated here.
[0188] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of the electronic device (the first electronic device or the second electronic device) disclosed in the present application. As Figure 7 shown, the electronic device 70 includes one or more processors 701 and a memory 702. The processor 701 and the memory 702 are connected through one or more communication buses 703. The memory 702 is used to store one or more computer programs 704. The one or more computer programs 704 are configured to be executed by the processor 701. The one or more computer programs 704 include instructions that can be used to execute the respective steps performed by the electronic device (such as a mobile phone) in the above embodiments to implement the application debugging function in the electronic device.
[0189] This embodiment also provides a computer storage medium in which computer instructions are stored. When the computer instructions run on an electronic device, the electronic device is caused to execute the above-related method steps to implement the application debugging method in the above embodiments.
[0190] This embodiment also provides a computer program product. When the computer program product runs on an electronic device, the electronic device is caused to execute the above-related steps to implement the application debugging method in the above embodiments.
[0191] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device runs, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the application debugging method in the above method embodiments.
[0192] Among them, the electronic device, the computer storage medium, the computer program product or the chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be elaborated here.
[0193] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0194] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0195] The unit described as a separate component may or may not be physically separated. The component displayed as a unit may be a physical unit or multiple physical units, that is, it can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0196] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0197] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks or optical discs and other various media that can store program codes.
[0198] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claimed rights.
Claims
1. An application debugging method, applied to a first electronic device, characterized in that, The first electronic device includes a system layer, an adaptation layer, and an application layer. The application layer includes an application to be debugged. The method includes: The adaptation layer determines display area configuration information, theme configuration information, and display orientation configuration information corresponding to a target device type and a target device theme; The adaptation layer sends the display area configuration information, the theme configuration information, and the display orientation configuration information to the system layer; The system layer determines the theme configuration information during debugging of the application to be debugged; The system layer renders the application interface of the application to be debugged according to the display area configuration information, the display orientation configuration information, the theme configuration information during debugging of the application to be debugged, and the page layout information in the page description, and displays the application interface of the application to be debugged on the target device on the screen of the first electronic device. The page description is sent by the application to be debugged to the system layer during the startup phase, and the page description includes the page layout information, and the page layout information indicates the page elements included in the application interface and the positions of the page elements.
2. The application debugging method according to claim 1, characterized in that Before the adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to a target device type and a target device theme, the method further includes: The adaptation layer receives the target device type and the target device theme sent by a second electronic device; The adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and the target device theme, specifically: The adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and the target device theme according to the corresponding relationship between the device type, device theme, and display area configuration information, theme configuration information, and display orientation configuration information pre-stored in the first electronic device.
3. The application debugging method according to claim 1, characterized in that Before the adaptation layer determines the display area configuration information, theme configuration information, and display orientation configuration information corresponding to a target device type and a target device theme, the method further includes: The adaptation layer receives the display area configuration information, theme configuration information, and display orientation configuration information corresponding to the target device type and the target device theme sent by a second electronic device.
4. The application debugging method according to any one of claims 1 to 3, characterized in that The system layer determines the theme configuration information during debugging of the application to be debugged, including: The system layer obtains the theme configuration information of the system layer, the theme configuration information of the adaptation layer, and the theme configuration information of the application layer, and determines the theme configuration information during debugging of the application to be debugged in the order of decreasing priority from high to low of the application layer, adaptation layer, and system layer.
5. The application debugging method according to claim 4, wherein The system layer obtains the theme configuration information of the system layer, including: The system layer obtains the theme configuration information of the system layer from the configuration information preset in the first electronic device; The system layer obtains the theme configuration information of the adaptation layer, including: The system layer sends a theme configuration request to the adaptation layer, and the theme configuration request is used to obtain the theme configuration information of the adaptation layer; In response to receiving the theme configuration request, the adaptation layer sends a theme configuration response to the system layer. The theme configuration response carries the theme configuration information of the adaptation layer, and the theme configuration information of the adaptation layer is the theme configuration information determined by the adaptation layer corresponding to the target device type and the target device theme; In response to receiving the theme configuration response, the system layer obtains the theme configuration information of the adaptation layer from the theme configuration response; The system layer obtains the theme configuration information of the application layer, including: The page description further includes the theme configuration information of the application layer, and the system layer obtains the theme configuration information of the application layer from the page description.
6. The application debugging method according to claim 5, wherein If the page description does not include the theme configuration information of the application layer, the theme configuration information of the application layer obtained by the system layer from the page description is empty, and the system layer determines the theme configuration information of the adaptation layer as the theme configuration information during the debugging of the application to be debugged.
7. The application debugging method according to any one of claims 1 to 3, characterized in that The system layer determines the theme configuration information during the debugging of the application to be debugged, including: If the page description further includes the theme configuration information of the application layer, the system layer obtains the theme configuration information of the application layer from the page description; The system layer determines the theme configuration information of the application layer as the theme configuration information during the debugging of the application to be debugged; Or, if the page description does not include the theme configuration information of the application layer, the system layer sends a theme configuration request to the adaptation layer, and the theme configuration request is used to obtain the theme configuration information of the adaptation layer; In response to receiving the theme configuration request, the adaptation layer sends a theme configuration response to the system layer. If the theme configuration response carries the theme configuration information of the adaptation layer, the system layer determines the theme configuration information of the adaptation layer as the theme configuration information during the debugging of the application to be debugged; Or, if the theme configuration response does not carry the theme configuration information of the adaptation layer, the pre-set configuration information of the first electronic device includes the theme configuration information of the system layer, and the system layer obtains the theme configuration information of the system layer from the pre-set configuration information of the first electronic device; The system layer determines the theme configuration information of the system layer as the theme configuration information during the debugging of the application to be debugged.
8. The application debugging method according to claim 1, characterized in that The system layer renders the application interface of the application to be debugged according to the display area configuration information, the display direction configuration information, the theme configuration information during the debugging of the application to be debugged, and the page layout information in the page description, including: The system layer draws the display area of the target device on the screen of the first electronic device according to the display area configuration information and the display direction configuration information; The system layer performs layout and rendering on the display area according to the theme configuration information during the debugging of the application to be debugged and the page layout information in the page description.
9. The application debugging method according to any one of claims 1 to 3, characterized in that, Before the adaptation layer determines the display area configuration information, the theme configuration information, and the display direction configuration information corresponding to the target device type and the target device theme, the method further includes: The application to be debugged sends the page description and event response information to the system layer during the startup phase, and the event response information includes the response manner of the operation event. The system layer determines the theme configuration information when the application to be debugged starts up. The system layer obtains the display area and display orientation of the first electronic device from the system hardware information of the first electronic device. The system layer renders the application interface of the application to be debugged according to the theme configuration information when the application to be debugged starts up, the display area and display orientation of the first electronic device, and the page layout information, and displays the application interface after the application to be debugged starts up.
10. The application debugging method according to claim 9, wherein The system layer determining the theme configuration information when the application to be debugged starts up includes: The system layer obtains the theme configuration information of the system layer, the theme configuration information of the adaptation layer, and the theme configuration information of the application layer, and determines the theme configuration information when the application to be debugged starts up in the order of decreasing priority from the application layer, the adaptation layer, and the system layer.
11. The application debugging method according to claim 9, wherein The method further includes: The adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme, and the operation configuration information includes the mapping relationship between the operation command and the operation event. The adaptation layer sends the operation configuration information to the system layer. The adaptation layer receives the operation command sent by the second electronic device, and the operation command is sent by the second electronic device in response to the first user operation, and the first user operation is used to indicate a specific operation on the application to be debugged on the target device. The adaptation layer determines the operation event corresponding to the operation command according to the operation configuration information. The adaptation layer sends the operation event to the system layer. In response to receiving the operation event, the system layer performs corresponding processing according to the operation event and the event response information.
12. The application debugging method according to claim 11, wherein Before the adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme, the method further includes: The adaptation layer receives the target device type and the target device theme sent by the second electronic device. The adaptation layer determining the operation configuration information corresponding to the target device type and the target device theme specifically includes: The adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme according to the corresponding relationship between the device type, the device theme, and the operation configuration information pre-stored in the first electronic device.
13. The application debugging method according to claim 11, wherein Before the adaptation layer determines the operation configuration information corresponding to the target device type and the target device theme, the method further includes: The adaptation layer receives the operation configuration information corresponding to the target device type and the target device theme sent by the second electronic device.
14. The application debugging method according to claim 11, wherein The operation command includes any one or more of the following: a first operation command indicating a physical key operation on the target device, a second operation command indicating a virtual key operation on the target device, and a third operation command indicating a touch operation on the target device.
15. The application debugging method according to any one of claims 1 to 3, characterized in that The application to be debugged includes a single-end application and a multi-end application.
16. A method for application debugging, applied to a second electronic device, characterized in that, The method includes: Receive the target device type and target device theme set by the user, where the target device type is used to indicate the device type of the target device, the target device is a device simulated by a first electronic device, and the target device theme is used to indicate the device theme of the target device; Send the target device type and the target device theme to the first electronic device, so that the first electronic device obtains the display configuration information corresponding to the target device type and the target device theme, and renders the application interface of the application to be debugged on the target device according to the display configuration information, so as to debug the display of the application interface of the application to be debugged on the target device.
17. The application debugging method according to claim 16, wherein The receiving the target device type and target device theme set by the user includes: Display a first debugging interface, where the first debugging interface includes two setting items of "target device type" and "target device theme"; Receive the target device type and the target device theme set by the user on the first debugging interface.
18. The application debugging method according to claim 16 or 17, characterized in that, After sending the target device type and the target device theme to the first electronic device, the method further includes: Receive a first user operation, where the first user operation is used to indicate a specific operation on the application to be debugged on the first electronic device on the target device; Send an operation command corresponding to the predetermined operation to the first electronic device, so that the first electronic device debugs the application operation of the application to be debugged on the target device.
19. A computer-readable storage medium, characterized in that, Includes computer instructions, when the computer instructions run on an electronic device, cause the electronic device to execute the application debugging method according to any one of claims 1 to 15, or execute the application debugging method according to any one of claims 16 to 18.
20. A first electronic device, characterized in that, The first electronic device includes a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the first electronic device executes the application debugging method according to any one of claims 1 to 15.
21. A second electronic device, characterized in that, The second electronic device includes a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the second electronic device executes the application debugging method according to any one of claims 16 to 18.
22. A chip system, characterized in that, The chip system is applied to an electronic device; the chip system includes an interface circuit and a processor; the interface circuit and the processor are interconnected by a line; the interface circuit is used to receive a signal from the memory of the electronic device and send the signal to the processor, and the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the chip system executes the application debugging method according to any one of claims 1 to 15, or executes the application debugging method according to any one of claims 16 to 18.
Citation Information
Patent Citations
Subjectediting method and device
CN104035771A