Compiling without the Crashlytics Mac App? - ios

I have to train some people on our iOS platform, and am trying to get them up to speed asap during a training session.
However, in order to properly run the app from Xcode, the Crashlytics
plugin is needed. Otherwise, the project won't compile and that kinda sucks.
I'm guessing one alternative would be to set up accounts for everybody,
have them download the plugin, properly link it to the app, and we'd be
fine.
BUT, is there another way around this? Is there some way to have them
running the app without the Mac App and all that hassle?
Thanks in advance!

You can check the 'Run script only when installing' checkbox on the Build Phases tab of the Target's properties.
That way you can run the App in the simulator without any hassle.

Mike from Crashlytics here. If the team won't be building any release configurations during the training session, then adding Conditional Logic around the Run Script is the best way to go. Note, that no crash reports would come through.
releaseConfig="Release"
if [ "$releaseConfig" = "${CONFIGURATION}" ]; then
echo "Running Crashlytics"
./Crashlytics.framework/run {your_api_key_here}
fi
Taken from here.

Just remove the Crashlytics run script from the Build Settings of your project.

Related

Xcode 9 is taking too much time to load the Application

I just installed the Xcode 9 for iOS 11 for my older project to update.
But it's taking too much time to load the app in Simulator as well as in iOS devices.
Are there any settings that I need to change in Xcode?
Also, I found one major issue is hitting the Mac machine.
I found another problem with Xcode recommended settings for Pods.
If you accept recommended settings, Xcode changes optimization level for Pods project to "Fast, Whole Module Optimization". It changes both of Debug and Release. You can change manually only for Release. That fixed my unnecessary building problem.
If you accepted recommended settings before, close Xcode and update and re-install pods. Than change optimization level for Pods project manually.
My First Answer
Commit changes and try again. It worked for me.
If you don't use git or another source control, you can find commit in Xcode's "Source Control" menu.
I'm not sure but It's good to clean compiled things too.
(on XCode menu > Product > Clean)
Sometimes delayed launching is because of large chunks of data being bundled with the app.
For eg: If you are uplaoding a json with huge data, the app will take time to process , bundle and install it which subsequently will lead to a delayed launch of the app.
So you need to verify whether something like that has been added to your project.

What does the "Fabric.framework/run" build phase actually do?

I use the Crashlytics framework for crash collecting in iOS Apps.
When you use the framework, a "Build Phase" is added to your target that runs /Fabric/Fabric.framework/run <big-hex-blob> <another-even-biger-hex-blob>.
I'd love to know that these actually do – I'm not entirely happy with having external vendors' tools monkey about with my build, I'm old school like that.
Mike from Crashlytics and Fabric here.
The run script build phase is used, along with your <APIkey> and <BuildSecret>, to automatically handle the uploading of dSYMs so that you, and other developers, never need to manually upload one.
Similarly, the /Crashlytics.framework/submit command is used for distributions through Beta, our beta distribution service.

How can you permanently change iOS app configuration in Meteor Cordova?

Every time I meteor build, I have to open XCode and do the following:
remove and add an item from "Link Binary With Libraries" (Facebook SDK)
add a URL Type (custom URL scheme for my app)
add a "Required device capabilities" to "Custom iOS Target Properties"
How can I edit my Meteor project to have these steps done automatically, and to auto add things to AndroidManifest.xml?
In some way use mobile-config.js or cordova-build-override?
I'm happy to see another guy who is trying to build a hybrid application using Meteor / extending a Meteor Cordova iOS app, since I'm facing the very same issues. So I'm very happy to share my experiences and approaches with you. :-)
So far, I ended up with the following approach:
I created a base template for my iOS app using meteor build (not meteor run ios-device, since I did not know if Meteor does some optimizations for production code).
Then, I copied the whole Xcode project under /platforms/ios to another loaction and used this new project as my "master" project from then on. This project is being enriched with native code, e.g. it also includes the Cocoa Pods I'm needing.
Of course, I also did not want to copy files each and every time I trigger a new Meteor build. At least, I would like to have the Staging/www folder updated, as this is happening quite frequently.
So my first (rather naive) approach was
delete the Staging/www folder in the master project
replace it with a relative link (using Xcode's linking functionality) to the Staging/www folder inside the .meteor/local/.../ios/ project
This approach did not work, since the shell script used in the Meteor Xcode project can't handle these links.
My second approach is to create a symlink on the filesystem level instead. This works as it should, and I'm able to build the project in Xcode as it should.
I could have followed the same approach for the Cordova plugins folder, but I've decided to replace the plugins manually in order to get a better control over them, even it means a bit more effort then.
Having the symlink in place also means that Xcode's version management (and also SVN which I am using for everything) will ignore everything below Staging/www, which is good in my opinion, because I'm already versioning the webapp code in the Meteor project itself.
BTW: I've started a discussion thread on hybrid mobile app on the Meteor forums as well, but so far it did not get too much attraction:
https://forums.meteor.com/t/building-a-hybrid-meteor-cordova-app-share-experiences/8212
Maybe we could follow up on Meteor-specific things there, to have the Meteor community participate in the discussion?
EDIT: I would also like to share an approach that failed completely, at least for me, maybe I was too dumb... Before I used Meteor's Xcode template as the starting point, I also tried it "the other way round", i.e. I started with my already existing Xcode app project and tried to include Meteor's / Cordova's part by hand. Using this approach, I never managed to set everything up correctly. I had lots of troubles and also had to tweak a lot of the compiler / linker flags to even get the code compiling. This grew me a lot of gray hairs. But even after I managed to get everything to compile, Meteor hang during startup - and I never figured out why.
One remaining problem I'm still facing is that Meteor's hot code push functionality seems to have some severe issues on iOS, that are also documented as GitHub issues. It can happen that the iOS app gets completely broken and needs to be reinstalled. I tried the mdg:reload-on-resume package, but this did not work as it should and made things even worse. As far as I can tell from the GitHub discussions, one should better disable hot code push until the Meteor team has addressed these issues. Breaking the app completely due to code pushes is not what my users would expect.
Unfortunately plist values (and assumably AndroidManifest.xml as well) can only be changed by a plugin:
Add entry to iOS .plist file via Cordova config.xml

XCode 6.3 Automate application launch with AppleScript

I'm developing an application for iOS and I'm using quite a lot of multithreading.
Because of that there are some nasty race conditions that sometimes cause a crash. It happens very rarely and in order to do produce the crash I need to manually launch my project hundreds of times.
My question is, is there a way to automate launches with Xcode 6.3 and Applescript?
I've seen scripts for XCode 4.0 and I tried writing one myself:
repeat 100 times
tell application "Xcode"
open "<PathToProject>/TestApplication.xcodeproj"
tell project "TestApplication"
clean
build
try
debug
end try
end tell
end tell
end repeat
From what I can tell it does run the clean and build commands but it just won't execute the debug or launch keywords.

Script for checking Build Mode in Xcode

I am creating a iOS Static Library in Xcode. I will be distributing two separate binaries, one for running in simulators(x86 architecture) & other for devices(ARM architecture).
I am aware of aggregate target, but I want to know whether it is possible to write a script to check whether the code is running in Debug or Release mode, i.e in Simulator(debug) or Device(Release) in ideal scenario.
Depending on this, I can put some check in my respective binary to compile or not.
Devices do not run in debug or release. The user chooses to build their target in debug or release. You can supply a debug version of your library, if you'd like, though. That is something I have seen other vendors do, and is greatly appreciated by developers.

Resources