Quote:
Originally Posted by littlep13
hi all,
i'm new on iphone app development. i've developed a little app and wanted to test it on my iphone 3g (os 2.2.1). after sending the app to my iphone with SSH and respring by BossPrefs, i couldn't find my app in the springboard.
before this little app, i did deploy some sample apps which i downloaded from the net successfully.
can anyone give me some idea about what went wrong?
thx
|
You have to notify the SB that something has changed.
If you have Cydia installed, try installing any App that would end up with an icon in the SpringBoard and Cydia should update the app-database with yours too.
You can get the same result by compiling and running this little program from a root SSH terminalsession on the phone:
Code:
#import <UIKit/UIKit.h>
#include <notify.h>
BOOL updateCache()
{
#define Cache_ "/private/var/mobile/Library/Caches/com.apple.mobile.installation.plist"
NSMutableDictionary *cache = [[NSMutableDictionary alloc] initWithContentsOfFile:@ Cache_];
if (cache != nil)
{
NSFileManager *manager = [NSFileManager defaultManager];
NSError *error = nil;
id sys = [cache objectForKey:@"System"];
if (sys != nil)
{
[sys removeAllObjects];
NSArray *apps = [manager contentsOfDirectoryAtPath:@"/Applications" error:&error];
if (apps != nil) {
for (NSString *app in apps)
if ([app hasSuffix:@".app"]) {
NSString *path = [@"/Applications" stringByAppendingPathComponent:app];
NSString *plist = [path stringByAppendingPathComponent:@"Info.plist"];
NSMutableDictionary *info = [[NSMutableDictionary alloc] initWithContentsOfFile:plist];
if (info != nil) {
if ([info objectForKey:@"CFBundleIdentifier"] != nil) {
[info setObject:path forKey:@"Path"];
[info setObject:@"System" forKey:@"ApplicationType"];
[sys setObject:info forKey:[info objectForKey:@"CFBundleIdentifier"]];
}
[info release];
}
}
}
[cache writeToFile:@ Cache_ atomically:YES];
system([[NSString stringWithFormat:@"chown root %@",@ Cache_] cString]);
}
notify_post("com.apple.mobile.application_installed");
[cache release];
return YES;
}
return NO;
}
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
updateCache();
[pool release];
return 0;
}
No guarantees and props to Saurik..