CN114281347A - Method for converting Taro small program code into APP - Google Patents

Method for converting Taro small program code into APP Download PDF

Info

Publication number
CN114281347A
CN114281347A CN202111622121.6A CN202111622121A CN114281347A CN 114281347 A CN114281347 A CN 114281347A CN 202111622121 A CN202111622121 A CN 202111622121A CN 114281347 A CN114281347 A CN 114281347A
Authority
CN
China
Prior art keywords
app
taro
packaging
applet
native
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.)
Pending
Application number
CN202111622121.6A
Other languages
Chinese (zh)
Inventor
李雪峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Xiaheng Network System Co ltd
Original Assignee
Nanjing Xiaheng Network System Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing Xiaheng Network System Co ltd filed Critical Nanjing Xiaheng Network System Co ltd
Priority to CN202111622121.6A priority Critical patent/CN114281347A/en
Publication of CN114281347A publication Critical patent/CN114281347A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for converting Taro small program codes into APP.A front end uses a Taro framework for development, a Native APP part uses a packaged XVview Native SDK, a Web end and a Native end interactively use a XVview JS SDK, and front-end personnel can call rich Native function modules only by compiling JS interactive codes; the invention provides an Xpack online packaging system, which can generate an APP installation package and download a two-dimensional code through a Web interface with simple operation, so that APP test and release become simple and convenient; the method and the system enable the APP to be rapidly generated and released even without native developers, because the developers do not need to care about native codes and native development environments, and the APP development threshold can be greatly reduced for developers unfamiliar with the APP based on software engineering developed by the Taro framework.

Description

Method for converting Taro small program code into APP
Technical Field
The invention belongs to the field of APP software engineering development, and particularly relates to a method for converting Taro small program codes into APP.
Background
In the field of mobile development, with the great popularization of APP and applets, different code implementation modes exist in technical development, and in the existing software development technology, applets and APPs are developed respectively due to different technical development languages.
The development mode of the hybrid APP at the present stage mainly takes Native or hybrid development as a main mode, and generally needs to be realized from Cordova and read Native, for example, and needs to be familiar with corresponding development language or rules to realize the development and packaging of the APP. With the popularity of applets, many mobile-side software needs to implement both applets and APP systems.
Under the background, the front end of Taro can well realize small program development, and supports the use of Vue and read to develop small programs, H5 and read Native, but the use of Taro can quickly develop small programs and applications such as H5, and the like, but the small program developed under Vue in the Taro scene has the defects that at present, a method for directly converting codes or packaging the codes into APP does not exist, the codes need to be manually written for conversion, and the development time cost is increased for users needing the small programs and the APP at the same time.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to solve the defects in the prior art, provides a method for converting Taro small program codes into APP, solves the problem that the development of the Taro small program by using Vue does not support the APP, and realizes the secondary conversion of the small program codes into the APP software, thereby avoiding the waste of time and cost of software developers due to the respective development.
The technical scheme is as follows: the invention discloses a method for converting Taro small program codes into APP, which comprises the following steps:
step S1, generating Taro front end engineering by using a command line tool Taro CLI, and selecting Vue or reach by a frame;
s2, installing project dependence and adding an XViejs SDK dependence library;
step S3, compiling Taro front-end page codes, running projects to an applet end, and previewing by using an applet developer tool;
s4, when the native API interaction is carried out, the API method provided by the XViejs SDK is directly called, and the universal object name is modified, so that the compatibility of the applet and the APP terminal can be realized;
such as when calling a call: modifying original Taro, makePhoneCall (phone number) of Taro into XView, makePhoneCall (phone number);
step S5, when the debugging of the applet is finished, the APP is debugged, if the applet is not temporarily considered in the installation project, the APP is directly packaged and debugged, namely, the step S6 is directly switched;
step S6, generating APP packaging resources, packaging APP ends, modifying Taro compiling configuration, changing an APP packaging resource generation directory into www, and keeping Taro default setting dist by a small program, so that two ends can be debugged at the same time in a development stage without mutual influence;
step S7, accessing an Xpack online packaging system, creating an APP, uploading application logo and www packaging resources, selecting a native component required by the application, and performing APP packaging and installation test;
and step S8, after the APP end tests correct, releasing the APK and IPA installation package files generated by the packaging system to the corresponding application market.
Further, when the Taro applet does not access the XVview JS SDK in the step S1, the Taro interaction code is automatically compiled and replaced according to the platform type, and if the Taro applet is the APP terminal, the original API of the Taro is replaced by the original interaction code of the XVview JS SDK.
Further, the specific method of step S2 is as follows:
s2.1, introducing the created Taro project by using Visual Studio Code;
s2.2, importing the related file of the XVview JS SDK dependency library.
Further, the specific operations involved in the native API interaction in step S4 are as follows:
s4.1, opening a page taro-app/src/pages/index.
S4.2, executing the command to perform small program packaging preview:
and (3) executing in a development stage: npm run dev: weapp;
and (3) executing in an issuing stage: npm build dev: weapp;
s4.3, importing the packaged dist small program project by using a small program development tool;
and S4.4, previewing the needed debugging function by using an applet development tool.
Further, the specific method for packaging in step S7 through the Xpack online packaging system is as follows:
s7.1, logging in a packaging system Xpack and creating an App application;
s7.2, uploading www.zip packaging resources to the App application;
s7.3, clicking a packaging button of a packaging interface;
s7.4, after the package is successful, the App downloading two-dimensional code and the installation package downloading link can be seen;
s7.5, installing an App to the mobile phone for testing.
Further, in step S7, the front end and APP packing operations may be completed by using a row of commands based on the Xpack-cli command row tool.
Has the advantages that: compared with the traditional method that the APP and the small program need to be developed separately, and the time of software engineering personnel is wasted, the method and the system directly convert the small program codes into the APP for the second time, and greatly save the development time. And the online deployment of the APP generated by the applet is realized.
Compared with the prior art, the invention has the following advantages:
(1) the front end uses a Taro framework for development, the Native APP part uses the packaged XVienative SDK, the Web end and the Native end use XVieJS SDK alternately, and front end personnel can call rich Native function modules only by writing JS alternate codes.
(2) The invention provides an Xpack online packaging system, which can generate an APP installation package and download two-dimensional codes (Android and iOS) through a Web interface (or a command line tool CLI) with simple operation, so that APP test and release become simple and convenient; the method and the system enable APP to be generated and released quickly even without native developers, because the developers do not need to care about native code and native development environment, and APP development thresholds can be greatly reduced for developers who are not familiar with APP.
Drawings
FIG. 1 is a schematic overall flow diagram of the present invention;
FIG. 2 is a schematic diagram of a module structure according to the present invention;
FIG. 3 is a schematic diagram of creating Taro engineering commands in an embodiment;
FIG. 4 is a schematic diagram of directly invoking the XVview JS SDK in the embodiment;
FIG. 5 is a diagram illustrating an embodiment of a debugging and dialing function previewed by a WeChat developer tool;
fig. 6 is a schematic diagram of the embodiment in which the App is finally installed to the mobile phone for testing.
Detailed Description
The technical solution of the present invention is described in detail below, but the scope of the present invention is not limited to the embodiments.
The method for converting the Taro applet code into the APP solves the problem that the development of the Taro applet by using Vue in the prior art does not support the APP, and as shown in fig. 1 and 2, the specific method comprises the following steps:
step S1, generating Taro front end engineering by using a command line tool Taro CLI, and selecting Vue or reach by a framework;
s1.1, node environment installation (> ═ 12.0.0)
S1.2, using npm or yarn to install @ tarojs/cli globally, or using npx directly;
install CLI using npm;
$npm install-g@tarojs/cli;
# OR uses a horn installation CLI;
$yarn global add@tarojs/cli;
# OR mounted cnpm and CLI mounted using cnpm;
$cnpm install-g@tarojs/cli;
s1.3, installing a Visual Studio Code;
s1.4, creating Taro front-end engineering;
as shown in fig. 3, the terminal in this embodiment executes the create Taro engineering command: a taro inittaro-app step S2, installing project dependence and adding an XViejs SDK dependence library;
s2.1, introducing the created Taro project by using Visual Studio Code;
s2.2, importing the related files of the XVview JS SDK dependency library;
s3, compiling Taro front-end page codes, running a project to an applet end, previewing the step S4 by using an applet developer tool, and directly calling an API method provided by an XVview JS SDK when the native API interaction is involved;
for example, when a dialing method is called, the original Taro. makephonecall (phone number) is modified into xview. makephonecall (phone number), and the compatibility of the applet and the APP terminal can be realized only by modifying the universal object name;
s4.1, opening a page taro-app/src/pages/index/index.vue, adding codes in template, as shown in FIG. 4, the embodiment only tests with a function of dialing a telephone, and an actual scene also relates to a plurality of Native function modules, wherein the XVieNature SDK and XVieJS SDK provided herein not only encapsulate commonly used small program function modules, but also include third-party SDKs, such as mainstream commonly used SDKs of WeChat, Paibao, aurora, Union, God, Baidu, sound network, and the like, and are continuously added and improved.
S4.2, executing a command to perform applet packaging preview:
and (3) executing in a development stage: npm run dev: weapp;
and (3) executing in an issuing stage: npm build dev: weapp;
s4.3, importing the packaged dist small program engineering by using a WeChat developer tool;
s4.4, previewing and debugging the dialing function by using a WeChat developer tool, as shown in FIG. 5;
step S5, after the debugging of the applet is finished, the APP is debugged, if the applet is not temporarily considered in the project, the APP is directly packaged and debugged, and the step S6 is skipped;
step S6, generating APP packaging resources, packaging APP ends, modifying Taro compiling configuration, changing an APP packaging resource generation directory into www, and keeping Taro default setting dist by a small program, so that two ends can be debugged at the same time in a development stage without mutual influence;
s6.1, modifying taro-app/config/index. js configuration, and adding the following codes:
outputRoot:`${process.env.TARO_ENV==="h5"?"www":"dist"}`,
s6.2, executing the command to generate App packaging resources;
npm run build:h5;
s6.3, compressing the www resource into www.zip packets after packaging;
and S7, accessing the Xpack online packaging system, creating an APP, uploading application logo and www packaging resources, selecting a native component required by the application, and performing APP packaging and installation test.
In the step, the development stage can also directly mark the net on the coil, so that the APP can be conveniently debugged in real time; besides Web page mode packing, the invention can also finish front end and APP packing operation through a line of commands based on an Xpack-cli command line tool.
S7.1, logging in a packaging system and creating an App application;
only demonstrating online packaging system packaging generates App application, under an actual scene, a command line tool CLI is provided for packaging, front-end engineering only needs to simply configure appid of native packaging application, APP can be directly packaged through command lines, and packaging APP operation becomes more convenient and faster.
S7.2, uploading www.zip packaging resources to the App application;
s7.3, clicking a packaging button of the packaging interface;
s7.4, after successful packaging, the App downloading two-dimensional code and the installation package downloading link can be seen;
s7.5, installing an App to the mobile phone for testing, as shown in figure 6;
and step S8, after the APP tests are correct, the APK and IPA installation package files generated by the packaging system are released to each application market.
In practical application, when the APP terminal is needed in the later stage, the operation is performed only by the following steps such as step S6, and the APP terminal packaging test is completed.
The present invention contemplates another situation, namely: if the Taro applet is well developed and is not accessed to the XVview JS SDK, the necessary reconstruction is needed to be carried out when the native API is directly converted into the APP, and at least the code called by the native API needs to be reconstructed.
It can be seen from the above embodiments that, when the Taro application is developed by the technical scheme of the present invention, since all Taro official APIs or small program APIs are secondarily encapsulated and code-isolated, developers do not need to worry about large-area application reconfiguration after official APIs are changed, and update can be completed only by modifying the secondarily encapsulated code; and a developer can perform one-layer packaging to list the common API, so that the method is more stable and efficient.
In conclusion, the invention can quickly generate APP based on small programs developed by Taro and provide corresponding tools; compared with the prior art, the method has lower learning cost and lower starting difficulty, developers familiar with the Taro small program can quickly start development of the APP end, and the existing Taro small program can be quickly converted into the APP.

Claims (6)

1. A method for converting Taro applet code into APP, characterized by: the method comprises the following steps:
step S1, generating Taro front end engineering by using a command line tool Taro CLI, and selecting Vue or reach by a frame;
s2, installing project dependence and adding an XViejs SDK dependence library;
step S3, compiling Taro front-end page codes, running projects to an applet end, and previewing by using an applet developer tool;
s4, when the native API interaction is carried out, directly calling an API method provided by the XViejs SDK, and modifying the universal object name to realize the compatibility of the applet and the APP terminal;
step S5, when the debugging of the applet is finished, the APP is debugged, if the applet is not temporarily considered in the installation project, the APP is directly packaged and debugged, namely, the step S6 is directly switched;
step S6, generating APP packaging resources, packaging APP ends, modifying Taro compiling configuration, changing an APP packaging resource generation directory into www, and keeping Taro default setting dist by a small program, so that two ends can be debugged at the same time in a development stage without mutual influence;
step S7, accessing an Xpack online packaging system, creating an APP, uploading application logo and www packaging resources, selecting a native component required by the application, and performing APP end packaging and installation test;
and step S8, after the APP end tests correct, releasing the APK and IPA installation package files generated by the packaging system to the corresponding application market.
2. Method for the conversion of Taro applet code into APP according to claim 1, characterized in that: and when the Taro applet does not access the XVview JS SDK in the step S1, automatically compiling and replacing the Taro interactive code according to the platform type, and if the Taro applet is the APP terminal, replacing the original API of the Taro into the original interactive code of the XVview JS SDK.
3. Method for the conversion of Taro applet code into APP according to claim 1, characterized in that: the specific method of step S2 is as follows:
s2.1, introducing the created Taro project by using Visual Studio Code;
s2.2, importing the related file of the XVview JS SDK dependency library.
4. Method for the conversion of Taro applet code into APP according to claim 1, characterized in that: the specific operations involved in the native API interaction in step S4 are as follows:
s4.1, opening a page taro-app/src/pages/index.
S4.2, executing the command to perform small program packaging preview:
and (3) executing in a development stage: npm run dev: weapp;
and (3) executing in an issuing stage: npm build dev: weapp;
s4.3, importing the packaged dist small program project by using a small program development tool;
and S4.4, previewing the needed debugging function by using an applet development tool.
5. Method for the conversion of Taro applet code into APP according to claim 1, characterized in that: the specific method for packaging in the step S7 through the Xpack online packaging system is as follows:
s7.1, logging in a packaging system Xpack and creating an App application;
s7.2, uploading www.zip packaging resources to the App application;
s7.3, clicking a packaging button of a packaging interface;
s7.4, after the package is successful, the App downloading two-dimensional code and the installation package downloading link can be seen;
s7.5, installing an App to the mobile phone for testing.
6. Method for the conversion of Taro applet code into APP according to claim 1, characterized in that: the front end and APP packing operations may also be completed in step S7 using a row of commands based on the Xpack-cli command row tool.
CN202111622121.6A 2021-12-28 2021-12-28 Method for converting Taro small program code into APP Pending CN114281347A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111622121.6A CN114281347A (en) 2021-12-28 2021-12-28 Method for converting Taro small program code into APP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111622121.6A CN114281347A (en) 2021-12-28 2021-12-28 Method for converting Taro small program code into APP

Publications (1)

Publication Number Publication Date
CN114281347A true CN114281347A (en) 2022-04-05

Family

ID=80876814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111622121.6A Pending CN114281347A (en) 2021-12-28 2021-12-28 Method for converting Taro small program code into APP

Country Status (1)

Country Link
CN (1) CN114281347A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115187170A (en) * 2022-07-12 2022-10-14 深圳市泰洲科技有限公司 Seamless clearance system and use method thereof
CN116185435A (en) * 2023-02-22 2023-05-30 太极计算机股份有限公司 Scaffold-based software development environment development method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115187170A (en) * 2022-07-12 2022-10-14 深圳市泰洲科技有限公司 Seamless clearance system and use method thereof
CN116185435A (en) * 2023-02-22 2023-05-30 太极计算机股份有限公司 Scaffold-based software development environment development method and device
CN116185435B (en) * 2023-02-22 2024-03-26 太极计算机股份有限公司 Scaffold-based software development environment development method and device

Similar Documents

Publication Publication Date Title
CN114281347A (en) Method for converting Taro small program code into APP
US8001519B2 (en) Model driven development including aspect integration tool
CN100543701C (en) A kind of method and system that realize embedded software unconventionality testing
Perchat et al. Component based framework to create mobile cross-platform applications
CN110928529A (en) Method and system for assisting operator development
KR20120095372A (en) The method and device for development environment converting
CN101382915B (en) Software debugging system and debugging method
CN104615462B (en) Cross-platform Mobile solution generation service end and system
JP5722448B2 (en) Image processing software development method, image processing software development apparatus, and image processing software development program
CN111045668B (en) Cross-platform mobile terminal system development method and device
CN111857801B (en) Construction method of mobile application
CN107122219A (en) The acquisition methods and device of installation file
CN113553035A (en) Design and construction method of universal front-end UI component library
CN111638870B (en) Front-end development basic platform based on reaction and reduce
CN112650487A (en) Hybrid application development method, system, computer device and storage medium
CN114371850A (en) Management method for project construction compiling and code development
CN101944061B (en) Method and device for debugging codes
Systa Dynamic reverse engineering of java software
CN104317580A (en) Integrated development environment for virtual test application (APP)
CN110580146B (en) Mixed application solving system based on eros
CN111142861B (en) Method and device for integrating structured comprehensive control system
CN117234529A (en) Method for generating API (application program interface) based on DSL (digital subscriber line) analytic resources
CN113641594B (en) Cross-terminal automatic testing method and related device
CN115509545A (en) IOS application packaging construction method and device
JP2006236375A (en) Web application development method, development support system, and program about development method

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