xcode 生成模拟器构建

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23950096/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:58:05  来源:igfitidea点击:

Generate simulator build

iosxcodefacebook-ios-sdk

提问by Pantelis Proios

I am working on an app that needs data from a Facebook app. Facebook want a release simulator build. I have followed FB's instruction to the letter but when i try to build the simulator package xcodebuild -arch i386 -sdk iphonesimulator7.1i get the following error:

我正在开发一个需要来自 Facebook 应用程序数据的应用程序。Facebook 想要一个发布模拟器构建。我已按照 FB 的说明进行操作,但是当我尝试构建模拟器包时xcodebuild -arch i386 -sdk iphonesimulator7.1,出现以下错误:

    ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:
    Ld build/Release-iphonesimulator/Olabord.app/Olabord normal i386
(1 failure)

I suspect that it has to do with cocoa pods but i don't know how to deal with it. I desperately need guidance or a workaround...!

我怀疑这与可可豆荚有关,但我不知道如何处理。我迫切需要指导或解决方法......!

回答by Tim

I had the same problem. Since you're working with a workspace file with pods you need to run the following in Terminal:

我有同样的问题。由于您正在使用带有 pod 的工作区文件,因此您需要在终端中运行以下命令:

xcodebuild -workspace {project name}.xcworkspace -scheme {project name}  -arch i386 -sdk iphonesimulator7.1

The FB instructions say the .app file should be in: {base directory}/build/Release-iphonesimulator/{projectname}.app

FB 说明说 .app 文件应该在:{base directory}/build/Release-iphonesimulator/{projectname}.app

In my case it ended up in /Developer/Derived Data/{project name}-{long string of random letters}/Build/Products/Debug-iphonesimulator

在我的情况下,它最终出现在 /Developer/Derived Data/{project name}-{long string of random letter}/Build/Products/Debug-iphonesimulator

回答by yoeriboven

Tim's answermight work, but if it doesn't go to the following path.Library/Developer/Xcode/DerivedData/your_application/Build/Products/Debug-iphonesimulator/your_application.appI sent that file (compressed) to Facebook and they accepted it.

蒂姆的答案可能会奏效,但如果它不走以下路径。Library/Developer/Xcode/DerivedData/your_application/Build/Products/Debug-iphonesimulator/your_application.app我将该文件(压缩)发送到 Facebook,他们接受了。

回答by Pradip Vanparia

xcodebuild -arch i386 -sdk iphonesimulator{version} -workspace [projectName].xcworkspace -scheme [projectName]

Follow the steps Click here

按照步骤点击这里

回答by PothiraJ

Go to simulator location, then copy projectName.appand past some where easy location.

转到模拟器位置,然后复制projectName.app并过去一些容易的位置。

In terminal type this comment:

在终端输入此评论:

ditto -ck --keepParent --sequesterRsrc /Users/pothiraj/Desktop/projectname.app /Users/spritzblr/Desktop/fileName.zip


ditto -ck --keepParent --sequesterRsrc {source} {destination}/fileName.zip

You will get the zip file in desktop.

您将在桌面中获得 zip 文件。

回答by Alok

Here are all steps to create simulator build including the installation process:

以下是创建模拟器构建的所有步骤,包括安装过程:

  • On Xcode, build and run the app on the simulator.
  • Then open “Activity Monitor” and find the name of the App you are running. Not Xcode, the actual App you are building. If you double click on the App Name, you should get a popup with the tab “Open Files and Ports”. Once you are on the tab you should get a long path for example /Users/webdigi/Library/Developer/CoreSimulator/Devices/A334134-2343-234A-234C-ASD1234EA3/Webdigi.app

  • The above is the location to the .app file that you need. Copy the .app file from that folder and send it across to the person who wants to run the app on their Simulator.

  • Now the other person should place the .app file to a location like Desktop

  • They have to then open Xcode and open a Simulator
  • On the command line type this command > xcrun simctl install booted $LOCATION/FILENAME.app replace $LOCATION with the path and the FILENAME should be the name
  • The App should appear on the Simulator, just click on the App to Launch it.
  • 在 Xcode 上,在模拟器上构建并运行应用程序。
  • 然后打开“活动监视器”并找到您正在运行的应用程序的名称。不是 Xcode,而是您正在构建的实际应用程序。如果双击应用程序名称,您应该会看到一个带有“打开文件和端口”选项卡的弹出窗口。一旦你在选项卡上你应该得到一个很长的路径,例如 /Users/webdigi/Library/Developer/CoreSimulator/Devices/A334134-2343-234A-234C-ASD1234EA3/Webdigi.app

  • 以上是您需要的 .app 文件的位置。从该文件夹复制 .app 文件并将其发送给想要在他们的模拟器上运行该应用程序的人。

  • 现在另一个人应该将 .app 文件放置到像桌面这样的位置

  • 然后他们必须打开 Xcode 并打开一个模拟器
  • 在命令行中键入此命令 > xcrun simctl install booted $LOCATION/FILENAME.app 用路径替换 $LOCATION 并且 FILENAME 应该是名称
  • 该应用程序应出现在模拟器上,只需单击该应用程序即可启动它。

回答by K.D

For xcodeworkshp pls make use of below command in terminal:

对于 xcodeworkshp,请在终端中使用以下命令:

xcodebuild -workspace {project name}.xcworkspace -scheme {project name}?-arch i386 -sdk iphonesimulator{your version supported}

回答by javaboygo

If you want to compile in 64 bits (avoiding 'This app will not work with future versions of iOS' message):

如果您想以 64 位编译(避免“此应用程序不适用于未来版本的 iOS”消息):

xcodebuild -workspace {project name}.xcworkspace -scheme {project name} -arch x86_64 ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator10.3

回答by Deepak Saki

1)Clean the derived data.

1)清理导出的数据。

2)Select the simulator and make a build.

2)选择模拟器并进行构建。

3)open finder and goto the path i.e. ~/Library/Developer/CoreSimulator/

3)打开finder并转到路径即~/Library/Developer/CoreSimulator/

4)Then go into the devices then goto into the other folder then go into the data then go into the containers then go into the bundle then go into the application then you will see folder which name in numeric form copy that folder and paste it to other location.

4)然后进入设备然后进入另一个文件夹然后进入数据然后进入容器然后进入包然后进入应用程序然后你将看到以数字形式命名的文件夹复制该文件夹并将其粘贴到其他地方。

5) Again come back from the application folder you will see the data folder then go into the data folder again you will see the application folder and under the application folder you will see other folder with numeric name the copy the numeric name folder and paste the folder on the same place where you paste the last application folder.

5)再次从应用程序文件夹返回您将看到数据文件夹然后再次进入数据文件夹您将看到应用程序文件夹在应用程序文件夹下您将看到具有数字名称的其他文件夹复制数字名称文件夹并粘贴文件夹位于粘贴最后一个应用程序文件夹的同一位置。

6) Share above two folder with the tester or anyone which want the simulator build.

6) 与测试人员或任何想要构建模拟器的人共享以上两个文件夹。