CN106648762B - Method and device for building development environment - Google Patents
Method and device for building development environment Download PDFInfo
- Publication number
- CN106648762B CN106648762B CN201611092791.0A CN201611092791A CN106648762B CN 106648762 B CN106648762 B CN 106648762B CN 201611092791 A CN201611092791 A CN 201611092791A CN 106648762 B CN106648762 B CN 106648762B
- Authority
- CN
- China
- Prior art keywords
- development kit
- development
- click event
- mouse click
- environment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000011161 development Methods 0.000 title claims abstract description 167
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000009434 installation Methods 0.000 claims abstract description 87
- 230000008569 process Effects 0.000 claims abstract description 19
- 238000010276 construction Methods 0.000 claims abstract description 9
- 230000002159 abnormal effect Effects 0.000 claims description 16
- 238000012790 confirmation Methods 0.000 claims description 16
- 238000001514 detection method Methods 0.000 claims description 10
- 230000008439 repair process Effects 0.000 claims description 8
- 238000004422 calculation algorithm Methods 0.000 claims description 6
- 230000006870 function Effects 0.000 description 14
- 238000012360 testing method Methods 0.000 description 4
- 230000007613 environmental effect Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 210000001072 colon Anatomy 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
- H04L63/123—Applying verification of the received information received data contents, e.g. message integrity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Cardiology (AREA)
- Environmental & Geological Engineering (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method and a device for building a development environment, wherein the method comprises the following steps: receiving a trigger signal, and detecting a network connection state according to the trigger signal; when the network connection state is normal, downloading the development kit from the server; installing the development kit by utilizing an automatic installation script program; configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment; the automatic installation script program is determined according to a mouse click event, the time interval of the mouse click event and an installation coordinate; therefore, when a user builds a development environment, the user can automatically detect the network connection state, download the installation package, automatically install and configure the environment variable by only sending one trigger signal, the building of the development environment is automatically completed, the condition that time and labor are wasted due to the fact that a developer is not familiar with building processes is avoided, and therefore working efficiency is improved.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a method and a device for building a development environment.
Background
The configuration of the development environment is a time-consuming process, meanwhile, in the process of configuring the development environment, versions of development tools at different periods may be inconsistent, and if the development environments in a project group are inconsistent, a lot of hidden troubles are caused to later development work.
Therefore, for a developer, the best state of the development environment is the same as the development environments of other colleagues in the project group, so that the program debugging state and the test state can be effectively ensured to be the same, and the influence of other factors on the program development can be effectively avoided.
In the prior art, the development environment is generally configured manually, and because the manual configuration of the development environment is a long process, especially for developers with less experience, the configuration of the development environment may take several weeks, and the work efficiency is reduced.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a method and a device for building a development environment, which are used for solving the technical problem that the working efficiency is reduced because time is consumed for manually configuring the development environment in the prior art.
The invention provides a method for building a development environment, which comprises the following steps:
receiving a trigger signal, and detecting a network connection state according to the trigger signal;
when the network connection state is normal, downloading the development kit from the server;
installing the development kit by utilizing an automatic installation script program;
configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment; wherein,
the automatic installation script program is determined according to the mouse click event, the time interval of the mouse click event and the installation coordinate.
In the foregoing solution, after configuring the execution file in the development kit into the corresponding environment variable, the method further includes:
detecting whether the configuration is successful, and if the configuration is determined to be abnormal, pushing prompt information about whether to repair;
and receiving confirmation information sent by a user, and repairing the configuration process based on the confirmation information.
In the above solution, when the network connection state is normal, downloading the development kit from the server includes:
sending a post request to the server to enable the server to return a download address and the first MD5 value of the development kit file based on the post request;
and downloading the development kit based on the download address, and verifying whether the development kit file is complete by using the first MD5 value.
In the foregoing solution, the verifying whether the development kit file is complete by using the first MD5 value includes:
calculating a second MD5 value of the development kit file by using a hash algorithm;
determining that the development kit file is complete when the first MD5 value is the same as the second MD5 value.
In the above solution, installing the development kit by using an automatic installation script program includes:
receiving a first mouse click event, and starting installation according to the first mouse click event;
receiving a corresponding mouse click event according to a preset time interval;
and clicking the corresponding installation coordinate to install based on the corresponding mouse click event.
The invention provides a device for building a development environment, which comprises:
the detection unit is used for receiving a trigger signal and detecting the network connection state according to the trigger signal;
the downloading unit is used for downloading the development kit from the server when the network connection state is normal;
an installation unit for installing the development kit by using an automatic installation script program;
the configuration unit is used for configuring the execution files in the development kit into corresponding environment variables, and the construction of the development environment is completed; the automatic installation script program is determined according to a mouse click event, the time interval of the mouse click event and the installation coordinate.
In the above scheme, the detection unit is further configured to:
detecting whether the configuration is successful, and if the configuration is determined to be abnormal, pushing prompt information about whether to repair;
and receiving confirmation information sent by a user, and repairing the configuration process based on the confirmation information.
In the foregoing solution, the downloading unit is specifically configured to:
sending a post request to the server to enable the server to return a download address and the first MD5 value of the development kit file based on the post request;
and downloading the development kit based on the download address, and verifying whether the development kit file is complete by using the first MD5 value.
In the above scheme, the apparatus further comprises: the verifying unit, which verifies whether the development kit file is complete by using the first MD5 value, includes:
calculating a second MD5 value of the development kit file by using a hash algorithm;
determining that the development kit file is complete when the first MD5 value is the same as the second MD5 value.
In the foregoing solution, the installing unit, which utilizes an automatic installation script program to install the development kit, includes:
receiving a first mouse click event, and starting installation according to the first mouse click event;
receiving a corresponding mouse click event according to a preset time interval;
and clicking the corresponding installation coordinate to install based on the corresponding mouse click event.
The invention provides a method and a device for building a development environment, wherein the method comprises the following steps: receiving a trigger signal, and detecting a network connection state according to the trigger signal; when the network connection state is normal, downloading the development kit from the server; installing the development kit by utilizing an automatic installation script program; configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment; the automatic installation script program is determined according to a mouse click event, a click event interval and an installation coordinate; therefore, when a user builds a development environment, the user can automatically detect the network connection state, download the installation package, automatically install and configure the environment variable by only sending one trigger signal, the building of the development environment is automatically completed, the condition that time and labor are wasted due to the fact that a developer is not familiar with building processes is avoided, and therefore working efficiency is improved.
Drawings
Fig. 1 is a schematic flow chart of a method for building a development environment according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device for building a development environment according to a second embodiment of the present invention.
Detailed Description
In order to avoid time and labor waste and further lower working efficiency caused by the fact that a developer is not familiar with the building process when building a development environment, the invention provides a method and a device for building the development environment, wherein the method comprises the following steps: receiving a trigger signal, and detecting a network connection state according to the trigger signal; when the network connection state is normal, downloading the development kit from the server; installing the development kit by utilizing an automatic installation script program; configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment; the automatic installation script program is determined according to a mouse click event, a click event interval and installation coordinates.
The technical solution of the present invention is further described in detail by the accompanying drawings and the specific embodiments.
Example one
The embodiment provides a method for building a development environment, as shown in fig. 1, the method includes:
s101, receiving a trigger signal, and detecting a network connection state according to the trigger signal.
In this step, when a developer wants to build a development environment, the developer only needs to send a trigger signal from the keyboard, and when the terminal device receives the trigger signal, the automatic building process is started. The development environment referred to in this embodiment is an Android development environment.
Here, the terminal device may detect the network connection state according to the trigger signal, and may perform the subsequent process only when the network connection state is normal.
Specifically, a local network connection state is detected by calling an internet getconnectictedstate function, after the detection is finished, the internet getconnectictedstate function returns a flag bit, and the network connection state can be judged by using the flag bit; such as: when the flag bit is larger than 0, determining that the network connection state is normally connected; and when the flag bit is less than or equal to 0, determining that the network connection state is abnormal.
And when the network connection state is abnormal, pushing a prompt message by using a show function in a MessageBox of the Windows, prompting a user that the network connection is abnormal, and asking for checking the network connection state.
When the network connection state is normal, the external network access state needs to be further tested; specifically, a PingRely function is called to test the state of PING of the current network.
Generally, a web address is required to be introduced as an object of PING to PING the network, such as www.baidu.com.
If the PingReply function PING succeeds, a true success status is returned, and if the PING fails, a false failure status is returned.
Therefore, whether the current network can be connected with the external network can be judged through the return value of the PingRely function. If the PING succeeds, it is indicated that the external network can be connected, and if the PING fails, it is indicated that the external network cannot be connected.
And if the user can not connect with the external network, pushing a prompt message by using a show function in the MessageBox to prompt the user that the external network access is abnormal.
And S102, downloading the development kit from the server when the network connection state is normal.
In this step, when the network connection state is normal and the external network can normally access, a post request is sent to the server, so that the server can return a download address and the first MD5 value of the development kit file based on the post request.
Here, the loading address returned by the server and the first MD5 value of the development kit file are encapsulated in JSON format, and after receiving the loading address and the first MD5 value of the development kit file, JSON needs to be analyzed by a FASTJSON method, so as to obtain the downloading address and the first MD5 value of the development kit file.
And after the download place is obtained, downloading the development kit based on the address, specifically, performing cache downloading by using a Stream form.
After the downloading is completed, checking whether the development kit file is complete by using the first MD5 value, specifically, calculating second MD5 value information of the development kit file by using a hash computehasher algorithm, and determining that the development kit file is complete when the first MD5 value is the same as the second MD5 value; when the first MD5 value is different from the second MD5 value, the fact that the development kit file is abnormal is determined, and at the moment, a prompt message is pushed to prompt a user to download again.
And S103, installing the development kit by utilizing an automatic installation script program.
In this step, after the development kit is downloaded, the development kit is installed by using an automatic installation script program.
The automatic installation script program is realized according to the step of recording manual installation, and can be determined according to a mouse click event, the time interval of the mouse click event and an installation coordinate, specifically, when the development kit is installed by using the automatic installation script program, a first mouse click event is received, and installation is started according to the first mouse click event; here, the first mouse click event may be a mouse click event for clicking to install the development kit, that is, a first mouse click event for installing the development kit.
And a fixed time interval is set between each mouse click event, so that the corresponding mouse click event is received according to the preset time interval, each mouse click event corresponds to the corresponding installation coordinate, and the corresponding installation coordinate can be clicked based on the corresponding mouse click event for installation.
Here, the software in the development kit mainly includes: JDK installation package, android SDK and android studio; the JDK is a Java language software development kit and is mainly used for Java application programs on mobile equipment and embedded equipment. JDKs are the core of the entire JAVA development, and contain the runtime environment of JAVA, JAVA facilities and JAVA-based class libraries. The Android studio is an Android integrated development tool, and provides an integrated Android development tool for development and debugging based on IntelliJ IDEA. Android sdk is a collection of development tools used by software development engineers to build application software for a particular software package, software framework, hardware platform, operating system, and the like.
In this way, the installation can be carried out automatically without any human involvement.
And S104, configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment.
In this step, after installation, the execution file in the development package needs to be configured to a corresponding environment variable, specifically, a JDK installation package, an android sdk installation package, and an android studio installation package.
When the JDK installation package is configured, the following is specifically performed:
when the JDK is configured, the content of the JDK is mainly added to the environment variables of the current Windows, and the Windows provides a way to add the environment variables, and the specific content is as follows:
PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_101\bin
wherein, the PATH represents the current environment variable value of Windows, and the configuring the environment variable is to perform the copy operation again to this PATH.
The two percentiles in the% PATH% represent the values of the original environmental variables, i.e., the details of the original PATH.
C \ Program Files \ Java \ jdk1.8.0_101\ bin: the value of the environment variable which represents that we need to add is the content of the execution file directory of the JDK package which we install; and the value of the original environment variable is separated by a colon.
The execution file path of the JDK can be effectively added into the environment variable by the method. The tool command in JDK can be called directly in CMD etc. command line after adding JDK's execution directory to environment variable.
When the android sdk installation package is configured, the following is specifically performed:
android SDK is a set of Android development kit provided by Android developers, the kit contains almost all Android tool sets, and Android development can be normally carried out on programs only if the Android SDK tool set is required.
The configuration of the android SDK mainly adds a development tool in the android SDK into an environment variable; specifically, the following information needs to be added to the swap variable PATH:
D:\tools\android-sdk-windows\tools
D:\tools\android-sdk-windows\platform-tools
wherein D \ tools \ android-sdk-windows \ tools is the path of sdk, a common debugging tool.
D \ tools \ android-SDK-windows \ platform-tools this path is the path that contains the SDK platform dependent tool set.
Here, the method of adding the android sdk to the environment variable PATH is the same as the above configuration JDK, and is not described herein again.
When the android studio installation package is configured, the android studio tool is a packaged tool set, and the environment of the tool is initialized after the full-automatic installation is completed, so that further configuration processing is not needed.
After the configuration is completed, in order to ensure that the program can normally run, after the execution file in the development kit is configured into the corresponding environment variable, the method further includes: the environment variables are tested to determine if the environment variables are configured correctly.
If the configuration is correct, the environment variable can be directly checked through the CMD command, and if the configuration is wrong, the CMD can prompt that the command cannot be found, so that whether the environment variable is correctly added or not can be judged according to the return value of the CMD.
For example, when JDK environment variables are tested, the following are specific:
an executable file in the JDK is java, the java-version command can be directly called through the CMD command, and if the version information of the java can be correctly output, the configuration of the JDK environment variable is correct. If the java command cannot be found, the JDK environment variable configuration error is shown.
If the JDK environment variable configuration determines that abnormity occurs, pushing prompt information about whether repair is performed or not; and receiving confirmation information, and repairing the configuration process of the JDK environment variable based on the confirmation information. Alternatively, the building of the development environment may also be re-performed.
When the configuration of the android SDK environment variable is tested, the configuration of the android SDK is correct by inputting the adb help in the CMD and if the help information related to the adb is output; if the output result is that the adb command cannot be found, the configuration of the android SDK environment is abnormal; if the android SDK environment variable configuration determines that the abnormality occurs, pushing prompt information about whether the repair is performed or not; and receiving confirmation information, and repairing the configuration process of the android SDK environment variable based on the confirmation information. Alternatively, the building of the development environment may also be re-performed.
Example two
Corresponding to the first embodiment, the present embodiment further provides a device for building a development environment, as shown in fig. 2, the device includes: a detection unit 21, a download unit 22, an installation unit 23, and a configuration unit 24; wherein,
the detection unit 21 is configured to receive a trigger signal and detect a network connection state according to the trigger signal; here, when the developer wants to build a development environment, the developer only needs to send a trigger signal from the keyboard, and the detection unit 21 starts an automatic building process when receiving the trigger signal. The development environment referred to in this embodiment is an Android development environment.
Here, the detecting unit 21 detects the network connection state according to the trigger signal, and only when the network connection state is normal, the subsequent process can be performed.
Specifically, the detecting unit 21 first detects the local network connection state by calling an internet getconnectidctatable function, and after the detection is completed, the internet getconnectidctatable function returns a flag bit, and the flag bit can be used to determine the network connection state; such as: when the flag bit is larger than 0, determining that the network connection state is normally connected; and when the flag bit is less than or equal to 0, determining that the network connection state is abnormal.
And when the network connection state is abnormal, pushing a prompt message by using a show function in a MessageBox of the Windows, prompting a user that the network connection is abnormal, and asking for checking the network connection state.
When the network connection state is normal, the external network access state needs to be further tested; specifically, a PingRely function is called to test the state of PING of the current network.
Generally, a web address is required to be introduced as an object of PING to PING the network, such as www.baidu.com.
If the PingReply function PING succeeds, a true success status is returned, and if the PING fails, a false failure status is returned.
The detection unit 21 can therefore determine whether the current network can connect to an external network by the return value of the PingReply function. If the PING succeeds, it is indicated that the external network can be connected, and if the PING fails, it is indicated that the external network cannot be connected.
And if the user can not connect with the external network, pushing a prompt message by using a show function in the MessageBox to prompt the user that the external network access is abnormal.
When the network connection state is normal, the downloading unit 22 is configured to download the development kit from the server; specifically, when the network connection state is normal and an external network can be accessed normally, a post request is sent to the server, so that the server can return a download address and the first MD5 value of the development kit file based on the post request.
Here, the loading address returned by the server and the first MD5 value of the development kit file are encapsulated in JSON format, and after receiving the loading address and the first MD5 value of the development kit file, JSON needs to be analyzed by a FASTJSON method, so as to obtain the downloading address and the first MD5 value of the development kit file.
And after the download place is obtained, downloading the development kit based on the address, specifically, performing cache downloading by using a Stream form.
Here, the apparatus further includes: a checking unit 25, after the downloading is completed, the checking unit 25 is configured to check whether the development kit file is complete by using the first MD5 value, specifically, the checking unit 25 calculates second MD5 value information of the development kit file by using a hash computehashe algorithm, and when the first MD5 value is the same as the second MD5 value, it is determined that the development kit file is complete; when the first MD5 value is different from the second MD5 value, the fact that the development kit file is abnormal is determined, and at the moment, a prompt message is pushed to prompt a user to download again.
After the development kit is downloaded, the installation unit 23 is configured to install the development kit by using an automatic installation script program; the automatic installation script program is implemented according to the step of recording manual installation, and may be determined according to a mouse click event, a time interval of the mouse click event, and an installation coordinate, specifically, when the development kit is installed by using the automatic installation script program, the installation unit 23 receives a first mouse click event, and starts installation according to the first mouse click event; here, the first mouse click event may be a mouse click event for clicking to install the development kit, that is, a first mouse click event for installing the development kit.
And a fixed time interval is set between each mouse click event, so that the corresponding mouse click event is received according to the preset time interval, each mouse click event corresponds to the corresponding installation coordinate, and the corresponding installation coordinate can be clicked based on the corresponding mouse click event for installation.
Here, the software in the development kit mainly includes: JDK installation package, android SDK and android studio; the JDK is a Java language software development kit and is mainly used for Java application programs on mobile equipment and embedded equipment. JDKs are the core of the entire JAVA development, and contain the runtime environment of JAVA, JAVA facilities and JAVA-based class libraries. The Android studio is an Android integrated development tool, and provides an integrated Android development tool for development and debugging based on IntelliJ IDEA. Android sdk is a collection of development tools used by software development engineers to build application software for a particular software package, software framework, hardware platform, operating system, and the like.
In this way, the installation can be carried out automatically without any human involvement.
After installation, the configuration unit 24 is configured to configure the execution file in the development kit to a corresponding environment variable, and the development environment is built.
The configuration unit 24 is specifically configured to configure the JDK installation package, the android sdk installation package, and the android studio installation package.
When the configuration unit 24 configures the JDK installation package, the following details are specifically provided:
when the JDK is configured, the content of the JDK is mainly added to the environment variables of the current Windows, and the Windows provides a way to add the environment variables, and the specific content is as follows:
PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_101\bin
wherein, the PATH represents the current environment variable value of Windows, and the configuring the environment variable is to perform the copy operation again to this PATH.
The two percentiles in the% PATH% represent the values of the original environmental variables, i.e., the details of the original PATH.
C \ Program Files \ Java \ jdk1.8.0_101\ bin: the value of the environment variable which represents that we need to add is the content of the execution file directory of the JDK package which we install; and the value of the original environment variable is separated by a colon.
The execution file path of the JDK can be effectively added into the environment variable by the method. The tool command in JDK can be called directly in CMD etc. command line after adding JDK's execution directory to environment variable.
When the configuration unit 24 configures the android sdk installation package, the specific configuration is as follows:
android SDK is a set of Android development kit provided by Android developers, the kit contains almost all Android tool sets, and Android development can be normally carried out on programs only if the Android SDK tool set is required.
The configuration of the android SDK mainly adds a development tool in the android SDK into an environment variable; specifically, the following information needs to be added to the swap variable PATH:
D:\tools\android-sdk-windows\tools
D:\tools\android-sdk-windows\platform-tools
wherein D \ tools \ android-sdk-windows \ tools is the path of sdk, a common debugging tool.
D \ tools \ android-SDK-windows \ platform-tools this path is the path that contains the SDK platform dependent tool set.
Here, the method of adding the android sdk to the environment variable PATH is the same as the above configuration JDK, and is not described herein again.
When the android studio installation package is configured, the android studio tool is a packaged tool set, and the environment of the tool is initialized after the full-automatic installation is completed, so that further configuration processing is not needed.
After the configuration is completed, in order to ensure that the program can normally run, after the execution file in the development kit is configured into the corresponding environment variable, the method further includes: the environment variables are tested to determine if the environment variables are configured correctly.
If the configuration is correct, the environment variable can be directly checked through the CMD command, and if the configuration is wrong, the CMD can prompt that the command cannot be found, so that whether the environment variable is correctly added or not can be judged according to the return value of the CMD.
For example, when JDK environment variables are tested, the following are specific:
an executable file in the JDK is java, the java-version command can be directly called through the CMD command, and if the version information of the java can be correctly output, the configuration of the JDK environment variable is correct. If the java command cannot be found, the JDK environment variable configuration error is shown.
If the JDK environment variable configuration determines that abnormity occurs, pushing prompt information about whether repair is performed or not; and receiving confirmation information, and repairing the configuration process of the JDK environment variable based on the confirmation information. Alternatively, the building of the development environment may also be re-performed.
When the configuration of the android SDK environment variable is tested, the configuration of the android SDK is correct by inputting the adb help in the CMD and if the help information related to the adb is output; if the output result is that the adb command cannot be found, the configuration of the android SDK environment is abnormal; if the android SDK environment variable configuration determines that the abnormality occurs, pushing prompt information about whether the repair is performed or not; and receiving confirmation information, and repairing the configuration process of the android SDK environment variable based on the confirmation information. Alternatively, the building of the development environment may also be re-performed.
Through one or more embodiments of the present invention, the present invention has the following advantageous effects or advantages:
the invention provides a method and a device for building a development environment, wherein the method comprises the following steps: receiving a trigger signal, and detecting a network connection state according to the trigger signal; when the network connection state is normal, downloading the development kit from the server; installing the development kit by utilizing an automatic installation script program; configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment; (ii) a The automatic installation script program is determined according to a mouse click event, the time interval of the mouse click event and an installation coordinate; therefore, when a user builds a development environment, the network connection state can be automatically detected, the installation package can be downloaded, automatic installation can be carried out, environment variables can be configured, the building of the development environment can be automatically completed, the condition that time and labor are wasted due to the fact that a developer is not familiar with the building process is avoided, the labor cost of the configuration environment is saved, and the working efficiency is improved; and because the downloaded development kit versions are the same, the debugging and testing states of the subsequent programs can be effectively ensured to be the same, and a good environmental foundation is laid for the later software development.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.
Claims (6)
1. A method of building a development environment, the method comprising:
receiving a trigger signal, and detecting a network connection state according to the trigger signal;
when the network connection state is normal and the external network can normally access, downloading the development kit from the server;
installing the development kit by utilizing an automatic installation script program;
configuring the execution files in the development kit into corresponding environment variables, and completing the construction of the development environment; wherein,
the automatic installation script program is determined according to a mouse click event, the time interval of the mouse click event and the installation coordinate; the development kit comprises: JDK installation package, android SDK and android studio;
when the network connection state is normal, downloading the development kit from the server, including:
sending a post request to the server to enable the server to return a download address and the first MD5 value of the development kit file based on the post request;
downloading the development kit based on the download address, and verifying whether the development kit file is complete by using the first MD5 value; wherein,
installing the development kit by using an automatic installation script program, comprising:
receiving a first mouse click event, and starting installation according to the first mouse click event;
receiving a corresponding mouse click event according to a preset time interval;
and clicking the corresponding installation coordinate to install based on the corresponding mouse click event.
2. The method of claim 1, wherein after configuring the execution file in the development kit into the corresponding environment variable, further comprising:
detecting whether the configuration is successful, and if the configuration is determined to be abnormal, pushing prompt information about whether to repair;
and receiving confirmation information sent by a user, and repairing the configuration process based on the confirmation information.
3. The method of claim 1, wherein said verifying whether said development kit file is complete using said first MD5 value comprises:
calculating a second MD5 value of the development kit file by using a hash algorithm;
determining that the development kit file is complete when the first MD5 value is the same as the second MD5 value.
4. An apparatus for setting up a development environment, the apparatus comprising:
the detection unit is used for receiving a trigger signal and detecting the network connection state according to the trigger signal;
the download unit is used for downloading the development kit from the server when the network connection state is normal and the external network can normally access;
an installation unit for installing the development kit by using an automatic installation script program;
the configuration unit is used for configuring the execution files in the development kit into corresponding environment variables, and the construction of the development environment is completed; the automatic installation script program is determined according to a mouse click event, the time interval of the mouse click event and an installation coordinate; the development kit comprises: JDK installation package, android SDK and android studio;
the download unit is specifically configured to:
sending a post request to the server to enable the server to return a download address and the first MD5 value of the development kit file based on the post request;
downloading the development kit based on the download address, and verifying whether the development kit file is complete by using the first MD5 value; wherein,
the installation unit installs the development kit by using an automatic installation script program, and includes:
receiving a first mouse click event, and starting installation according to the first mouse click event;
receiving a corresponding mouse click event according to a preset time interval;
and clicking the corresponding installation coordinate to install based on the corresponding mouse click event.
5. The apparatus of claim 4, wherein the detection unit is further to:
detecting whether the configuration is successful, and if the configuration is determined to be abnormal, pushing prompt information about whether to repair;
and receiving confirmation information sent by a user, and repairing the configuration process based on the confirmation information.
6. The apparatus of claim 4, wherein the apparatus further comprises: the verifying unit, which verifies whether the development kit file is complete by using the first MD5 value, includes:
calculating a second MD5 value of the development kit file by using a hash algorithm;
determining that the development kit file is complete when the first MD5 value is the same as the second MD5 value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611092791.0A CN106648762B (en) | 2016-11-30 | 2016-11-30 | Method and device for building development environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611092791.0A CN106648762B (en) | 2016-11-30 | 2016-11-30 | Method and device for building development environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106648762A CN106648762A (en) | 2017-05-10 |
CN106648762B true CN106648762B (en) | 2020-08-04 |
Family
ID=58813726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611092791.0A Active CN106648762B (en) | 2016-11-30 | 2016-11-30 | Method and device for building development environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106648762B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109582291A (en) * | 2018-10-16 | 2019-04-05 | 深圳壹账通智能科技有限公司 | Develop environment control method, device, computer equipment and storage medium |
CN109634624A (en) * | 2018-12-12 | 2019-04-16 | 浪潮(北京)电子信息产业有限公司 | A kind of method, apparatus of software deployment, equipment and storage medium |
CN110531962B (en) * | 2019-08-06 | 2023-11-17 | 上海连尚网络科技有限公司 | Development processing method and device for applet and computer readable storage medium |
CN112214253B (en) * | 2020-09-11 | 2024-02-02 | 拓尔思信息技术股份有限公司 | Java program starting method and device, electronic device and nonvolatile storage medium |
CN116185435B (en) * | 2023-02-22 | 2024-03-26 | 太极计算机股份有限公司 | Scaffold-based software development environment development method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104899047A (en) * | 2015-06-25 | 2015-09-09 | 广州杰赛科技股份有限公司 | Webpage frame deployment method and system |
CN105227910A (en) * | 2015-09-22 | 2016-01-06 | 中国石油天然气集团公司 | A kind of wireless monitor warning system based on Internet of Things |
CN105306434A (en) * | 2015-09-11 | 2016-02-03 | 北京金山安全软件有限公司 | Program file checking method and device, server and terminal |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130326487A1 (en) * | 2012-05-31 | 2013-12-05 | Shenol YOUSOUF | Emulating cloud functioning of applications locally |
CN103324505B (en) * | 2013-06-24 | 2016-12-28 | 曙光信息产业(北京)有限公司 | The method disposing GPU development environment in group system and cloud computing system |
CN104579745A (en) * | 2014-12-04 | 2015-04-29 | 国家电网公司 | Mobile terminal and network inspection system |
CN104581713A (en) * | 2015-01-15 | 2015-04-29 | 福建天晴数码有限公司 | Intelligent equipment networking method, device, equipment and system |
-
2016
- 2016-11-30 CN CN201611092791.0A patent/CN106648762B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104899047A (en) * | 2015-06-25 | 2015-09-09 | 广州杰赛科技股份有限公司 | Webpage frame deployment method and system |
CN105306434A (en) * | 2015-09-11 | 2016-02-03 | 北京金山安全软件有限公司 | Program file checking method and device, server and terminal |
CN105227910A (en) * | 2015-09-22 | 2016-01-06 | 中国石油天然气集团公司 | A kind of wireless monitor warning system based on Internet of Things |
Also Published As
Publication number | Publication date |
---|---|
CN106648762A (en) | 2017-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106648762B (en) | Method and device for building development environment | |
US9940225B2 (en) | Automated error checking system for a software application and method therefor | |
KR101008977B1 (en) | Method of testing OSGi service platform and test tool thereof | |
US8978015B2 (en) | Self validating applications | |
WO2017067441A1 (en) | Method, device and system for testing application, and non-transient machine-readable storage medium | |
CN105302716A (en) | Method and apparatus for test in joint development mode | |
CN111382048B (en) | Management method and device for mobile equipment on true machine test platform | |
CN109885480B (en) | Automatic interface compatibility testing method and device based on debugging bridge | |
CN111045944A (en) | Regression testing method, device and system and computer readable storage medium | |
CN102447732A (en) | Method for intelligent configuration of host computer embedded environment during BMC (Baseboard Management Controller) development | |
CN106897223A (en) | A kind of software kit delivery method and device based on continuous integrating | |
CN112241311A (en) | Firmware simulation method and device, electronic equipment and readable storage medium | |
CN104125504A (en) | Deployment method, device and system based on continuous integration | |
CN106502713A (en) | A kind of method for upgrading software and system | |
CN106528415A (en) | Software compatibility test method, business platform and system | |
US20080127118A1 (en) | Method and system for dynamic patching of software | |
CN112052037A (en) | Application software development method, device, equipment and medium | |
CN113836023A (en) | Compiler security testing method based on system structure cross check | |
CN112911283A (en) | Smart television testing method and device | |
CN110990833B (en) | SDK safety detection method and related equipment | |
CN110928787B (en) | Automatic test script recording and playback method, device, equipment and storage medium | |
CN102043654A (en) | DSP simple development method based on TMS320VC55xx | |
CN107612786B (en) | Method and system for testing router | |
CN114880244A (en) | Application testing method and device, storage medium and electronic equipment | |
CN115604307A (en) | Processing method and device for upgrading log, terminal equipment and computer medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |