Creating an iOS Simulator Build of CocoaPods project

耗尽温柔 提交于 2019-12-18 10:09:32

问题


I need to create a simulator build in order to submit my app to facebook team for further review of my open graph.

They have a instruction to create that here facebook instruction

But I use cocoapods and I can not make this build. everytime it gives me error.


回答1:


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

Follow the steps Click here




回答2:


Here is the another easy method to create .zip file

  • Step 1: open finder and press command⌘ + shift⇧ + g
  • Step 2: paste "~/Library/Developer/Xcode/DerivedData"
  • Step 3: select your_app_name-jkfksdfhskdhfksdh some thing like this folder
  • Step 4: your_app_name-jkfksdfhskdhfksdh >>Build>>Products>>Debug-iphonesimulator

  • Step 5: You will see 2 files one is your_app_name.app(icon like rounder and 1 cross line ) and 2nd file is your_app_name.app.dSYM

  • Step 6: To create .zip file right click on your_app_name.app and select "Compress your_app_name". It will generate .zip file and submit it to facebook.



回答3:


I'm in the same boat and have been struggling with this!

I managed to get my build working by adding the following to the command line args:

-workspace [Name.xcworkspace] -Scheme [NameOfScheme]

I also had to edit the scheme and add the Pods target explicitly as it was failing the build with Library not found for -lPods.




回答4:


Having the same issue, I had both errors fixed @bean his error by adding 'i386' to the "valid architectures" in build settings. (for my app target, pod target and every pod separately)

My full build command is:

xcodebuild -workspace [projectName].xcworkspace -scheme [schemeName] -arch i386 -sdk=iphonesimulator7.1

I can complete the build but I get tons warnings:

warning: no rule to process file '[any .m file]' of type sourcecode.c.objc for architecture i386

I have no idea how to fix this, an .app file is created just not on the location the facebook tutorial says it should be (its in "~/Library/Developer/Xcode/DerivedData/.." instead of "{projectDir}/build/...")

Now 2 questions remain for me:

1.) How can I test or this .app file works (double-clicking it tells me the file is damaged.)

2.) (Why) Can I not just build the app from within Xcode using the simulator and just submit the .app file that Xcode created?




回答5:


Facebook updated its guidelines how to make a simulator built (link)

  1. Run your app in your Xcode iPhone 5 simulator. This automatically creates a simulator build in Xcode's DerivedData cache.

  2. Run: ditto -ck --sequesterRsrc --keepParent ls -1 -d -t ~/Library/Developer/Xcode/DerivedData/*/Build/Products/*-iphonesimulator/*.app | head -n 1 path/to/YourApp.zip This automatically zips the simulator build.

  3. You can verify the simulator build by using the ios-sim utility Command-line App Launcher for Simulator.

  4. Submit YourApp.zip.




回答6:


it's simple as going to ~/Library/Developer/Xcode/DerivedData//Build/Products/-iphonesimulator/XXXX.app copy you XXXX.app from there and copy to desktop ..right click and select compress.. you will a zip file for your app.Submit it to fB




回答7:


Developers who has failed with @Pradip Vanparia's Solution like me this will work:

xcodebuild -workspace {project name}.xcworkspace -scheme {project name}  -arch i386 -sdk iphonesimulator9.3

And I found iphonesimulator9.3 by following command:

xcodebuild -showsdks



回答8:


The just "Copy/Past" way :

ditto -ck --sequesterRsrc --keepParent `ls -1 -d -t ~/Library/Developer/Xcode/DerivedData/*/Build/Products/*-iphonesimulator/*.app | head -n 1` MyApp.zip


来源:https://stackoverflow.com/questions/23482823/creating-an-ios-simulator-build-of-cocoapods-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!