reseting Finder from objective c/swift in sandbox - objective-c

I'm trying to rest Finder from my code (in sandbox). One of the approaches that I tried is calling following apple script:
tell application \"Finder\" to quit
but it doesn't seem to work on the Mavericks. Any ideas?

You need to add the com.apple.security.scripting-targets sandboxing entitlement to script other apps from within the sandbox. Please check
How to run an AppleScript from a sandboxed application on a Mac (OS X)

Related

Capture logs (errors, warnings) in exported/deployed OSX app

I am exporting my app as a .app and testing it on different OSX versions and machines. Is there any way to capture warnings, errors, etc. to a log?
The application is not crashing so a crash log is not being generated.
The best way to capture these is using something similar to TestFairy (framework for android / ios beta testing), I suggest you take a look at that, to see what functionalities it provides and the search for something similar on mac os.
Found these two for Mac :
hockeyapp
plccrashreporter

How to run unsigned cocoa app build on another mac?

OS X 10.9.4
X-Code 5.1.1
I don't have Mac Developer Program account.
I created app for OS X, builded unsigned .app. It runs perfectly and works on my Mac. When I copy application to another Mac with the same version of OS X, try to run but nothing leads. Application icon starts appear in Dock and immediately disappears without any message. Running in the console gives an error "LSOpenURLsWithRole () failed with error -10810", unfortunately -10,810 is an unknown error.
I tried the same thing with a empty application "HelloWorld", it did not run too. Install and run applications from unknown developers in security setting is turned on.
I tried build LASlider example-project (https://github.com/Doshipak/LADSlider), that I use in my project. When I run it on another mac, app crashes like HelloWorld & my project..
Does someone has similar problems?
What had happened: Safari download invalid *.app from Dropbox with empty app body, same thing happens if you try to transfer *.app with TeamViewer. But result file looks normal.
Decision: always pack *.app in archive.

xcode timed out waiting for app to launch

Application get fail to launch in device having iOS 6.0 from xcode 4.5. Xcode says Application can't be launched timed out waiting for app to launch. I reset my all device settings. Cross checked if i choosed right provisioning. Yes, its right. here i am attaching image of console. Please help me out.
None of the above tips helped me. It turned out I was using my Distribution Profile instead of the Developer Profile in Debug mode. You can check the Profile you are using by going to
Build Settings->Code Signing Entity.
Make sure you are using your Developer Profile in Beta and Debug mode.
I had a similar issue when trying to debug an App with Ad-Hoc provisioning... Check which provisioning you're using, it seems ad-hoc provisioning cannot be used for debbuging.
Whenever this happens to me, I have done the following to fix the problem:
Stop the app from running in Xcode.
Delete the app from the device (or Simulator).
Select Product > Clean from the Xcode menu.
Close Xcode.
Close the Simulator (or restart the device).
Restart your computer (yes I know this like a Windows solution but seriously).
Try again.

Install an IPA through USB?

After using the "iPhone Configuration Utility" program to install IPA applications to my iPhone on the go, I wondered how this process worked. Within a few Google searches, I found out about "MobileDevice.framework" and the "MobileDevice Library" connected to it. After reading an article of all the Known Functions in the library, I found one called "AMDeviceInstallApplication". I thought this would work once I saw install, but I'm currently perplexed on how to use it.
TL;DR I have IPA files and I want to make an Xcode program (for Mac) that installs the IPA's application to a connected iOS device when a button is pressed.
Also, don't worry about the application not being signed correctly. It is signed with a provisioning profile installed on devices [the application] will be used with.
If you're still interested in this problem I've written a blog entry on how to install apps on a connected iPad / iPhone without using Xcode or iTunes.
This method allows you to run a Terminal command to install an iPA file.
http://pervasivecode.blogspot.co.uk/2012/06/install-ios-app-ipa-file-without-xcode.html
I suppose you could bundle up the terminal commands in your application and use it that way?
I found a simple way to install iPa file to real iPhone or iPad:
Connect iPhone to Mac via USB and follow the below steps:
Steps to follow:
Open Xcode
Click on Window
Select Devices and Simulators
Drag and drop the IPA files into it
App got installed on the iPad

Debugging iOS app built from commandline

I am building an app for iOS via commandline but I am having problems debugging it. Had I built using XCode, it would have let me "build and debug" on device without problems. But now, I don't know how to launch it on device using gdb and step through it. If I try to "add a custom target/executable" to a blank XCode project and then launch it, XCode complains about not finding the executable. Same thing happens if I install the app on device manually and try to attach to it using gdb within XCode. Any pointers on how to go about debugging this app? Changing the build process to use XCode is not an option.
This site gives a nice tutorial on how to manually set up a remote debugging session on an iOS device. The process boils down to creating a remote debugging server on the device and attaching to it with a local GDB instance.