Stop xcode before run? - ios

I have a bug which occurs because an user installs the app but doesn't run it. He adds some files via itunes and only then runs the installed app.
So I need to repeat the same actions. Breakpoints should help but I don't know where to insert them. NOTE: main.m is not the starting point so I can't just place breakpoint in it - some code is executed before it (maybe because of submodules).
How to solve this issue?

Edit the scheme, in the Run Info find the Launch section at the bottom and select Wait for executable to be launched.
Now, when you run, Xcode will install the app and wait. You can then do whatever you want with the device / iTunes and when you manually start the app Xcode will kick in.

You can build your app from the "Product" menu without running. Then open Xcode's "Devices" window, select your target device, and drag your app from the "Products" section of the Project navigator to the Installed Apps part of the device window. That should get you an installed build that hasn't been launched.

Related

iOS Launch Image Works in Dev but not App Store Version

I have an iOS app and I am trying to get the launch screen to work properly. It works fine when I run the app in the simulator or on-device via xCode. But after I upload the binary to the App Store the splash screen image stops working.
I am using Cordova and cordova-plugin-splashscreen.
It looks like it's still trying to load it and comes up with the spinner but the image doesn't appear.
What can cause differences between a local run and an App Store build?
This is what the broken App Store version looks like on initial boot. It eventually does end up loading properly and the app runs fine. But it looks horrible while loading.
When you build and run on local device, you are building using the "Run" scheme, whereas when you build your app for the App Store you use the "Profile" scheme. The Build Configuration for the Run scheme is called "Debug" whereas the build configuration for the Profile scheme is called "Release".
In order to fix the problem and achieve parity, you need to change the build configuration for the Run scheme to "Release". You do that in this way:
Click on the app icon next to the play button on the top left in XCode.
Select "Edit Scheme".
Click on "Run" in the left pane.
Change Build Configuration to "Release".
Close.
Build and Run.
In theory, your app should now run as it does when downloaded from the app store.
https://www.youtube.com/watch?v=kXdzk3qhCWc&list=PLt2cCXacqzgfUAjHYnZ9rrPkih4NzAV4E&index=8&t=94s
I think you need to satisfy the Apple about your launch assets
as shown in above video link may help you. If i understand properly your question.
Thank you.

Testing a closed ios app

I'm currently trying to handle different application states (closed, background or in a different tab of the app) however when I try to test how the app works when it is closed and receives a push notification(double click home and force close the app then reopen it) I'm not sure where I'm going wrong in the code. Since I'm reopening the app from the phone itself and not xcode I can't test to see which method isn't being reached because no output is available in the console. Is there any way to test a situation like this or simulate a force close event in xcode so that when i re run the app on the phone it also launches in xcode?
I appreciate any responses.
Cheers!
If you force close app or stop (from xcode) then it close the connection with xcode. Then if you open it from phone then it will not make connection with xcode. You must run it from xcode. And there is no difference in opening app from phone or running from xcode. App's flow will be same in both case. So what you want to test that which methods get calls and in which sequence that you can check by rerunning the project.
Update:
Select the Scheme on the toolbar (just left beside from your device or simulator list)
Choose Edit Scheme
Select Run in the left panel
For the Launch option, select Wait for executable to be launched
Refer this link for more details
Since I'm reopening the app from the phone itself and not xcode I can't test to see which method isn't being reached because no output is available in the console.
In Xcode, hold down the Option key and choose Product->Run..., and then edit the Run scheme to use the "Wait for executable to be launched" option. You should then be able to choose Run in Xcode, and then open your app by some other means, such as responding to a notification, and Xcode will still connect and let you debug.
To debug the process after restarting the app again, attach the Xcode debug console to the running process.
In Xcode do:
Debug > Attach to process > [select your process]

Run app phonegap with xcode on jailbroken iPhone

I developed an app with phonegap, and I hate to try on a apple device. I've jailbroken my iPhone5s for try my app without pay apple.
I follow this guide, but seems does't work:
On your Jailbroken device install AppSync Unified 5.2-1 (or later)
from AngelXWind’s repo. Don’t use any other AppSync, and if you have
others, be sure to remove them. Open
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist
and change AD_HOC_CODE_SIGNING_ALLOWED to YES. You may need to
duplicate it to the desktop, change it, save it, then drag and drop
back into the original folder because OS X let you edit the file in
place. If XCode was running, restart XCode. Change your Project and
Target settings to “Ad Hoc Code Sign” in Build Settings Tell XCode to
run app on iPhone. At this point XCode will put app on your iDevice,
but can’t debug because it can’t attach to the process. The app will
start then close immediately. You can now manually start the app on
the phone now though. To enable debugging: In your project select
File>New File Property List and create a file called
“Entitlements.plist”. Add “Can be debugged” or “get-task-allow” (both
do the same thing) and set the value to YES. Now change your Project
and Target Code Signing Entitlements (In Build Settings) to
“Entitlements.plist” (you have to type it in). Now XCode can run and
debug the app. Good luck
This is the link of the guide.
When I run app, XCode tell me "Build Success", and on top it says :"Running on Iphone". If I open detail, it say: "Preparing to install " with a loading circle. It's 20 minute that is preparing to install my app.
How can I fix this problem?

Spark Inspector

I am interested in Spark Inspector, but i cant use it in trial mode.
I installed latest version. Then i used framework setup assistant, but it not helps.
Building settings are correct - i checked it step by step with this instructions: http://www.sparkinspector.com/framework_setup.html
I also tried to clean project and delete app from iOS simulator.
The app is for iPad, i don't know is it matter.
The error i getting is: "Setup did not complete successfully. The Spark Inspector timed out waiting for the console to settle."
I love this tool - It actually includes a wizard that lets you choose a xcode project and sets it up for inspection. try using the built in wizard.
EDIT: With version 1.3.3 of Spark Inspector, it seems it sometimes takes a while for SI to connect to the process. After you get the error, try clicking the OK button and wait for about 30 seconds. It should eventually connect. Otherwise, try some of the other tips below.
Deleting the Xcode Derived Data sometimes fixes this for me:
launch Xcode
from menubar: Xcode > preferences
click the 'Locations' tab
beneath "Derived Data" you'll see a path with a small arrow icon, click on the arrow
from the Finder window that appears, drag the 'DerivedData' folder (should be automatically selected) into the trash
quit Xcode
restart Xcode and try launching Spark Inspector again
Another thing to check is to make sure your command line tools are setup to run the same version as your current version of Xcode (happens sometimes if you have multiple copies installed at the same time like a beta):
launch Xcode
from menubar: Xcode > preferences
click the 'Locations' tab
Check the current value for 'Command Line Tools'. If it's not the same version as the Xcode version you're trying to run Spark from, then:
Select correct version
Delete the Derived Data
Quit Xcode
Restart Xcode
Clean your project (cmd-K)
Try re-running with Spark
I had the same problem. Make sure you have the dylib in the following path:
Applications/Spark Inspector.app/Contents/Resources/Frameworks/SparkInspector.dylib
I re-installed the application, force xcode to quit, re-opened xcode and the project. I've clean the project as you did and then use Product-Inspect with spark.
It takes few secondes to start after the simulator is launch. It also breaks on a line on the debugger until the inspector app is launched.
Hope this will help

iPad2 device build does not update when I do a new build

I am having a consistent problem with multiple different apps that the build on the device does not update when I make code changes. Here's my set up:
OSX Lion
Xcode 4.1
iOS 4.3.5
I build, and then run, the app launches on the device but it still runs the last installed version. In order to get the build to update, I have to do the following...
Remove the app from the device (press and hold on the icon, and click the x)
Clean and then build in Xcode
At this point if I try and run the app does not run. Xcode log says the app has started and stopped. If I restart Xcode and run, then the app runs successfully and is the updated version
If I make a single line of code change I have to go through all the steps above to get the app to update. The project is very large so a clean build takes 2-3 minutes.
Any ideas?
Update
I found the solution, this is related to the use of static libraries. The following article helped me solve this:
Changing the source of a static library needs clean and build in xcode 4
and for general background this was very helpful too:
http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/
Double check your provisioning files and targets. Be extra sure to check the App ID in your targets, and Bundle ID in info.plist. Did you change any of that info before you saw this problem? I've noticed strange behavior like what you mentioned when updating those specific pieces of data.
Command+Shift+K -- Clean. I have found that you have to do a manual clean every time now to ensure that the build updates correctly.
In the event that xCode does not run at all, you just have to restart xCode.

Resources