在5分钟内创建一个ios和android应用

    科技2022-07-12  128

    介绍 (Introduction)

    React Native is a JavaScript framework for building cross platform mobile apps. In this tutorial, I’ll show you how to quickly set up a React Native project and run your app on your actual device! The code for this tutorial can be found on my GitHub.

    React Native是用于构建跨平台移动应用程序JavaScript框架。 在本教程中,我将向您展示如何快速设置React Native项目并在实际设备上运行您的应用程序! 可以在我的GitHub上找到本教程的代码。

    世博会 (Expo)

    In this tutorial, we will be using expo with React Native. Expo acts as a container around the React Native framework that allows us to develop applications more quickly and easily compared to if we were using bare bones React Native. The first thing we need to do is install the Expo CLI command line utility. Open your terminal and run the following command:

    在本教程中,我们将把EXPO与React Native一起使用。 Expo充当React Native框架的容器,与我们使用裸骨React Native相比,它使我们可以更快,更轻松地开发应用程序。 我们需要做的第一件事是安装Expo CLI命令行实用程序。 打开您的终端并运行以下命令:

    npm install -g expo-cli

    Now we can create a new React Native project. I will call my project ExampleProject but you can call it whatever you like.

    现在我们可以创建一个新的React Native项目。 我将其命名为ExampleProject,但您可以随心所欲地调用它。

    expo init ExampleProject

    Expo will prompt you with the following message:

    世博会提示您以下消息:

    For this tutorial, I will select blank but I encourage you to do some research and select the best option for your project.

    对于本教程,我将选择空白,但我鼓励您进行一些研究并为您的项目选择最佳选择。

    运行我们的应用 (Running Our App)

    Believe it or not, our app is ready to be run! To start our app we must move into the folder which contains our app and then run the start command.

    信不信由你,我们的应用程序已准备好运行! 要启动我们的应用程序,我们必须移入包含我们应用程序的文件夹,然后运行start命令。

    cd AwesomeProjectnpm start

    When you run ‘npm start’, a new browser window will open at your local host. You will notice a barcode in the lower left hand corner.

    当您运行“ npm start”时,将在本地主机上打开一个新的浏览器窗口。 您会在左下角看到条形码。

    We can scan this barcode in the expo app to run our app on a device. Go to either the Apple App Store or the Google Play Store and search for ‘expo client’. See the image below.

    我们可以在expo应用程序中扫描此条形码,以在设备上运行我们的应用程序。 前往Apple App Store或Google Play商店并搜索“ expo client”。 参见下图。

    Once you download and open the app, you will see an option to “Scan QR Code”. Tap this and scan your code. After the JavaScript loads, you should be able to see the app on your device. If you see “Open up App.js to start working on your app!” you have done it correctly.

    下载并打开该应用程序后,您将看到“扫描QR码”的选项。 点击此按钮并扫描您的代码。 加载JavaScript后,您应该可以在设备上看到该应用程序。 如果您看到“打开App.js开始使用您的应用程序!” 您已正确完成。

    结论 (Conclusion)

    Now go out and start building the app of your dreams! If you want the exact code I used in this tutorial, it can be found on my GitHub and this post and more can be found on my website. Happy coding!

    现在出发,开始构建您梦想中的应用程序! 如果您想要我在本教程中使用的确切代码,可以在我的GitHub上找到它,这篇文章以及更多内容可以在我的网站上找到 。 编码愉快!

    翻译自: https://levelup.gitconnected.com/create-an-ios-and-android-app-in-under-5-minutes-5e3fd70582ee

    相关资源:微信小程序源码-合集6.rar
    Processed: 0.010, SQL: 8