Thursday, June 16, 2011

Some useful scrips/commands

Reading the crash reports  
Requirements:
1. You need crash report - AppName.crash file 
2. AppName.dSYM file - which is generated with the build. The .dSYM should match which the build which is crashed.(You can find .dSYM file in build folder with the application)
Command:
Type the command below in Terminal for reading crash 
atos -o /MyApp.dSYM/Contents/Resources/DWARF/MyApp -arch armv7 0x00088d9c
Procedure:
1.Type atos -o in the terminal 
2.Right click on the MyApp.dSYM file then select "Show Package Contents" then drag and drop the file in /MyApp.dSYM/Contents/Resources/DWARF/MyApp to the terminal 
3. Type -arch armv7. (type armv6 if you are using old devices <iPhone4)  
4. Open .crash file and enter the address(refer fig) and press enter
5. It will display the function name which is crashed
6. Follow the same steps for remaining addresses(the addresses below the arrow mark in image) to get the sequence.


Removing all .svn files in a folder
Command:
find "/YourFolder" -name ".svn" -exec rm -fdR {} \;

Checking the distribution build
1. codesign -dvvvv yourAppName
2. Checking the entitlements : codesign -dvvvv --entitlements - /YourApp.app
          Check whether the Authority is Distribution
          Authority=iPhone Distribution:yourCompany, Inc
          Authority=Apple Worldwide Developer Relations Certification Authority
          And also for proper working of push notification check whether 'aps-environment' is 'production'

Thursday, June 9, 2011

Angle between two points

This is the sample application to rotate the arrow pointer based on the touch point below is the logic for rotating a view according to touch point and you can download the source at https://github.com/chandanshetty01/RotateArrow

 #define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__) * 57.29577951f) // PI * 180

-(float32) getRotatingAngle : (CGPoint)firstPoint secondPoint:(CGPoint)secondPoint
{
float dx = firstPoint.x - secondPoint.x;
float dy = firstPoint.y - secondPoint.y;
float angle = CC_RADIANS_TO_DEGREES(atan2(dy, dx));
return angle;
}