xcode 模拟器关闭程序_如何将您的应用程序从一个xcode模拟器转移到另一个

xcode 模拟器关闭程序

使iOS应用在模拟器上轻松运行 (Making iOS app running on simulator easy)

Here is how the story began! I was asked by product team to run the app under development on their machines. Not all the members own the physical iOS device which obviously aren’t cheap :D. As a developer I think everyone will agree with me that product teams in the company are always eager to get their hands on the project status in a tangible manner. And when it comes to a mobile app, eagerness is even more as everyone has a smart device in their pocket.

^ h ERE就是故事的开始! 产品团队要求我在他们的机器上运行正在开发的应用程序。 并非所有成员都拥有物理iOS设备,这显然并不便宜:D。 作为开发人员,我认为每个人都会同意我的看法,即公司中的产品团队始终渴望以切实的方式掌握项目状态。 当涉及到移动应用程序时,每个人都在口袋里装有智能设备,因此更加渴望。

This was an interesting requirement so I set out to explore solutions. Since this would be used by non-developers my goal was to:

这是一个有趣的要求,因此我着手探索解决方案。 由于非开发人员可以使用它,因此我的目标是:

  • Find a simplest solution which doesn’t involve too much technicality

    查找不涉及太多技术的最简单解决方案
  • Come up with an automated way to minimize the developer time in training and maintaining it.

    提出一种自动方法,以最大程度地减少开发人员在培训和维护方面的时间。

After spending a lot of time searching on the internet

花了很多时间在互联网上搜索

这是我找到的一些选项: (Here are some options I found:)

解决方案1:只需从Xcode运行该应用程序 (Solution 1: Simply run the app from Xcode)

Even though this option can work but has multiple complexities and dependencies

即使此选项可以工作,但具有多种复杂性和依赖性

  • Basic understanding of version control — Usually product teams are not used to version control that devs use for code management. For eg, in order to make sure they are up to date they need to make sure they keep pulling the latest code. So there is a learning curve involved here which might not make sense for someone who is not a developer.

    对版本控制的基本了解—通常,产品团队不习惯开发人员用于代码管理的版本控制。 例如,为了确保它们是最新的,需要确保它们不断获取最新代码。 因此,这里涉及学习曲线,这对于不是开发人员的人可能没有意义。
  • Dependency Changes — Every iOS project uses dependency manager, for eg. pod to manage external libraries. Anytime new dependency is added, a dependency update is needed to be run on the machine itself. Basically our user needs to learn how to build the app from existing code. Again an overkill for the expected outcome.

    依赖项更改—每个iOS项目都使用依赖项管理器,例如。 用于管理外部库的pod。 每当添加新的依赖项时,都需要在计算机本身上运行依赖项更新。 基本上,我们的用户需要学习如何从现有代码构建应用程序。 再次对预期结果产生了过大杀伤力。

解决方案2:访问.app文件并使用它在模拟器上安装 (Solution 2: Accessing the .app file and use it to install on the simulator)

I settled on this approach because it is easier for a non-developer to follow and execute.

我选择这种方法是因为非开发人员更容易遵循和执行。

这是我的设置方法: (Here is how I set this up:)

1. Find the app file — When you run the app on simulator, it shows all the process on your activity monitor. Filter out the process by searching for your app name. In my case, my test app name is SimulatorApp as you can see in the screen shot below.

1查找应用程序文件 -在模拟器上运行该应用程序时,它会在活动监视器上显示所有过程。 通过搜索您的应用名称来过滤过程。 就我而言,我的测试应用程序名称为SimulatorApp,如下面的屏幕快照所示。

Image for post
Filter for app name
过滤应用名称

Double click on your app process name and you will see another window. On that screen select Open Files and Ports.

双击您的应用进程名称,您将看到另一个窗口。 在该屏幕上,选择“ 打开文件和端口”。

App location where it is installed

2.复制应用文件 (2. Copy app file)

You will see your app name path in above screenshot, in my case app name is SimulatorApp.app file. Copy that file to your preferred location and then zip it. Now move this zipped file to other computer and unzip the file. And open the simulator on your other machine as shown below.

您将在上面的屏幕截图中看到您的应用程序名称路径,在我的情况下,应用程序名称为SimulatorApp.app文件。 将该文件复制到您的首选位置,然后将其压缩。 现在,将此压缩文件移动到其他计算机并解压缩该文件。 并如下图所示在另一台计算机上打开模拟器。

Image for post
Open simulator from Xcode
从Xcode打开模拟器

Please note — In the above screenshot, depending on your version of Xcode, you should see the simulator option if not everything else.

请注意-在上面的屏幕截图中,根据您所使用的Xcode版本,您应该看到模拟器选项(如果不是全部)。

3在模拟器上安装应用程序文件 (3. Install the app file on simulator)

  • Unzip the file transferred from other machine

    解压缩从其他机器传输的文件
  • Drag and drop the file as shown below

    拖放文件,如下所示
Image for post
Installing app on simulator
在模拟器上安装应用

可选步骤 (Optional Step)

If you want to simulate other devices or OS, you can do it very easily as shown below.

如果要模拟其他设备或操作系统,则可以非常容易地进行操作,如下所示。

Image for post

Once you switch the simulator, wait for it to start and do the same drag and drop as shown in step 3 above.

切换模拟器后,请等待其启动并进行与上述步骤3相同的拖放操作。

自动化解决方案 (Automate the Solution)

The above solution works great but this is not automated. Here is what we can do to make it better. We usually have some some sort of CI/CD for our builds. Add a step to build the app for simulator, then access the location Debug-iphonesimulator in your build folder which has .app file. You can upload this file to a shared location say google drive and it can be easily downloaded by any member of product team. By automating this, we can make sure the product team is experiencing current latest progress of your app and can have timely feedback.

上面的解决方案很好用,但这不是自动化的。 这是我们可以做的更好的事情。 我们通常会在构建时使用某种CI / CD。 添加一个步骤来构建用于模拟器的应用程序,然后访问具有.app文件的构建文件夹中的位置Debug-iphonesimulator 。 您可以将此文件上传到共享位置(例如Google驱动器),并且产品团队的任何成员都可以轻松下载该文件。 通过自动执行此操作,我们可以确保产品团队正在体验您应用程序的最新进展,并可以及时获得反馈。

Originally published at https://www.shashankthakur.dev.

最初发布在 https://www.shashankthakur.dev

翻译自: https://medium.com/swlh/how-to-transfer-your-app-from-one-xcode-simulator-to-another-f65beb6a178e

xcode 模拟器关闭程序

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值