Summary of the invention
The technical problem to be solved in the present invention, be to provide the method for utilizing the short distance microwave telecommunication devices to carry out the ADB debugging on a kind of android platform, can under the situation that existing debugging technique means all lost efficacy, the debugged apparatus of android platform be debugged.
The present invention is achieved in that the method for utilizing the short distance microwave telecommunication devices to carry out the ADB debugging on a kind of android platform, described method need provide the debugged apparatus of a commissioning device and band android platform, and described commissioning device comprises: instruction input module, short distance microwave telecommunication devices and data resolution module; Described debugged apparatus comprises: data memory module, debugging acid ADB, short distance microwave telecommunication devices and command analysis module; This method specifically comprises the steps:
Step 1, open the short distance microwave telecommunication devices of commissioning device and debugged apparatus, with the short distance microwave telecommunication devices of the commissioning device routing node as the autonomous network of short distance microwave telecommunication devices, finish the link of two short distance microwave telecommunication devices; Distribute the address of an IPV6 respectively in the autonomous network of described short distance microwave telecommunication devices, for two short distance microwave telecommunication devices;
Step 2, need the order of debugging by instruction input module input one, instruction input module is created an empty file one, and with the demanded storage of described debugging in file one;
The short distance microwave telecommunication devices of step 3, instruction input module notice commissioning device, produce a short distance microwave telecommunication devices data protocol message, and file one is inserted the user data area of this data protocol message, and the data protocol message is packaged into the udp protocol message, the short distance microwave telecommunication devices of commissioning device extend this as the address of the short distance microwave telecommunication devices IPV6 of debugged apparatus with the address field of this udp protocol message, and this udp protocol message is being broadcasted in autonomous network;
After the short distance microwave telecommunication devices of step 4, debugged apparatus receive udp protocol message in the autonomous network, the address of address field in this udp protocol message and the short distance microwave telecommunication devices IPV6 of self is compared, inconsistent, then do not operate; Consistent, then the short distance microwave telecommunication devices of debugged apparatus receive the udp protocol message and resolve, obtain short distance microwave telecommunication devices data protocol message, and the described file one that obtains in this short distance microwave telecommunication devices data protocol message is saved in the android plateform system of debugged apparatus, extracts debug command by command analysis module from this document one;
Step 5, the mechanism of the Inter-Process Communication by android plateform system socket send to debugging acid ADB with debug command;
After step 6, debugging acid ADB obtain debug command, carry out this debug command, form the system journal of debugging, create an empty file two, and system journal is stored in this empty file two;
The file that contains system journal two that step 7, data memory module will produce sends to the short distance microwave telecommunication devices of debugged apparatus, the short distance microwave telecommunication devices produce a short distance microwave telecommunication devices data protocol message, and file two is inserted the user data area of this data protocol message, and the data protocol message is packaged into the udp protocol message, the short distance microwave telecommunication devices of debugged apparatus extend this as the address of the short distance microwave telecommunication devices IPV6 of commissioning device with the address field of this udp protocol message, and this udp protocol message is being broadcasted in autonomous network;
After the short distance microwave telecommunication devices of step 8, commissioning device receive udp protocol message in the autonomous network, the address of address field in this udp protocol message and the short distance microwave telecommunication devices IPV6 of self is compared, inconsistent, then do not operate; Consistent, then the short distance microwave telecommunication devices of commissioning device receive the udp protocol message and resolve, obtain short distance microwave telecommunication devices data protocol message, and the described file two that obtains in this short distance microwave telecommunication devices data protocol message is saved in the commissioning device;
Step 9, data resolution module extract system journal from this document two, resolve and obtain debug results.
The present invention has following advantage: the present invention is by after obtaining debug command at commissioning device short-distance and medium-distance microwave telecommunication devices, be transferred in the debugged apparatus again, debugged apparatus is resolved debug command by command analysis module, and the debug command after will resolving is issued debugging acid ADB and debugged.The present invention can also can debug the debugged apparatus of android platform under the situation that existing debugging technique means all lost efficacy; And simple to operate, debugging efficiency is fast.
Embodiment
See also illustrated in figures 1 and 2, the present invention carries out the method for ADB debugging for utilizing the short distance microwave telecommunication devices on a kind of android platform, described method need provide the debugged apparatus of a commissioning device and band android platform, and described commissioning device comprises: instruction input module, short distance microwave telecommunication devices and data resolution module; Described debugged apparatus comprises: data memory module, debugging acid ADB, short distance microwave telecommunication devices and command analysis module; This method specifically comprises the steps:
Step 1, open the short distance microwave telecommunication devices of commissioning device and debugged apparatus, with the short distance microwave telecommunication devices of the commissioning device routing node as the autonomous network of short distance microwave telecommunication devices, finish the link of two short distance microwave telecommunication devices; Distribute the address of an IPV6 respectively in the autonomous network of described short distance microwave telecommunication devices, for two short distance microwave telecommunication devices; For example: the address of the short distance microwave telecommunication devices of debugged apparatus is referred to as Addr_1, and the address of the short distance microwave telecommunication devices of commissioning device is referred to as Addr_2;
Step 2, need the order of debugging by instruction input module input one, instruction input module is created an empty file one, and with the demanded storage of described debugging in file one;
The short distance microwave telecommunication devices of step 3, instruction input module notice commissioning device, produce a short distance microwave telecommunication devices data protocol message, and file one is inserted the user data area of this data protocol message, and the data protocol message is packaged into the udp protocol message, the short distance microwave telecommunication devices of commissioning device extend this as the address of the short distance microwave telecommunication devices IPV6 of debugged apparatus with the address field of this udp protocol message, and this udp protocol message is being broadcasted in autonomous network;
After the short distance microwave telecommunication devices of step 4, debugged apparatus receive udp protocol message in the autonomous network, the address of address field in this udp protocol message and the short distance microwave telecommunication devices IPV6 of self is compared, inconsistent, then do not operate; Consistent, then the short distance microwave telecommunication devices of debugged apparatus receive the udp protocol message and resolve, obtain short distance microwave telecommunication devices data protocol message, and the described file one that obtains in this short distance microwave telecommunication devices data protocol message is saved in the android plateform system of debugged apparatus, extracts debug command by command analysis module from this document one;
Step 5, the mechanism of the Inter-Process Communication by android plateform system socket send to debugging acid ADB with debug command;
After step 6, debugging acid ADB obtain debug command, carry out this debug command, form the system journal of debugging, create an empty file two, and system journal is stored in this empty file two;
The file that contains system journal two that step 7, data memory module will produce sends to the short distance microwave telecommunication devices of debugged apparatus, the short distance microwave telecommunication devices produce a short distance microwave telecommunication devices data protocol message, and file two is inserted the user data area of this data protocol message, and the data protocol message is packaged into the udp protocol message, the short distance microwave telecommunication devices of debugged apparatus extend this as the address of the short distance microwave telecommunication devices IPV6 of commissioning device with the address field of this udp protocol message, and this udp protocol message is being broadcasted in autonomous network;
After the short distance microwave telecommunication devices of step 8, commissioning device receive udp protocol message in the autonomous network, the address of address field in this udp protocol message and the short distance microwave telecommunication devices IPV6 of self is compared, inconsistent, then do not operate; Consistent, then the short distance microwave telecommunication devices of commissioning device receive the udp protocol message and resolve, obtain short distance microwave telecommunication devices data protocol message, and the described file two that obtains in this short distance microwave telecommunication devices data protocol message is saved in the commissioning device;
Step 9, data resolution module extract system journal from this document two, resolve and obtain debug results.
In the present invention, described commissioning device also comprises data disaply moudle, also comprises after described step 9: step 10, debug results is shown one by one by described data disaply moudle, finish debugging task one time.
Described short distance microwave telecommunication devices are: the radio communication ZigBee equipment of low-power consumption or short-distance wireless communication z-wave equipment.
In addition, in the step 1 of the present invention with the short distance microwave telecommunication devices of the commissioning device routing node as the autonomous network of short distance microwave telecommunication devices, the link of finishing two short distance microwave telecommunication devices is specially: with the short distance microwave telecommunication devices of the commissioning device routing node as the autonomous network of short distance microwave telecommunication devices, open broadcast wireless signal, the short distance microwave telecommunication devices of debugged apparatus detect the Web broadcast wireless signal of the short distance microwave telecommunication devices of commissioning device, the short distance microwave telecommunication devices that application adds with commissioning device are the autonomous network of routing node, the short distance microwave telecommunication devices of commissioning device receive the adding application of sending from the short distance microwave telecommunication devices of debugged apparatus, it is joined among this autonomous network, finish the link of two short distance microwave telecommunication devices.
Wherein, the short distance microwave telecommunication devices are: a kind of emerging based on radio frequency, low cost, low-power consumption, highly reliable, the short-distance wireless communication technology that is suitable for network.Be responsible for the debug command of commissioning device is sent to debugged apparatus in the present invention, and obtain debug results from debugged apparatus and be transferred to commissioning device.
Instruction input module: be used for the input of commissioning staff's debug command.
Command analysis module: responsible debug command of sending from commissioning device by reading command in the short distance microwave telecommunication devices of debugged apparatus and execution.
Socket: the communication mechanism between the process in the operating system is the important component of operating system; It is responsible for the data transmission between each module of device interior.
Debugging acid ADB:Android Debug Bridge is the debugging technique of Android platform internal standard, is responsible for receiving debug command, carries out debug command, obtains debug results, sends operations such as debug results.
Data memory module: be responsible for obtaining debug results from the debugging acid ADB of debugged apparatus, and be stored as file.
Data resolution module: responsible for obtaining the file that contains debug results (being the file of data storage cell storage above-mentioned) that sends from debugged apparatus in the short distance microwave telecommunication devices in the commissioning device, resolve.
Data disaply moudle: be responsible for showing the debug results that parses, obtain from debugged apparatus at the screen of commissioning device.
In a word, the present invention can also can debug the debugged apparatus of android platform under the situation that existing debugging technique means all lost efficacy; And simple to operate, debugging efficiency is fast.
The above only is preferred embodiment of the present invention, and all equalizations of doing according to the present patent application claim change and modify, and all should belong to covering scope of the present invention.