2

can any one help me . I want to retrieve applications name which are running in background only.

I need name of apps only, programmatically (by coding).

Thanks in advance.

Saroj Ojha
  • 79
  • 2
  • 4

2 Answers2

2

It is possible to get a list of running processes. See this answer: Return a list of running background apps/processes in iOS.

However, you only get process names (not the whole application name's or titles), which might be misleading or there may be same names for different applications.

Community
  • 1
  • 1
kuba
  • 7,329
  • 1
  • 36
  • 41
  • I need the process type only i.e is it running in background or foreground – Saroj Ojha Apr 16 '12 at 10:13
  • in ios there is only one application in foreground - that is your app. All other are in background. – kuba Apr 16 '12 at 10:13
  • 2
    //Get frontmost application char frontmostAppS[256]; memset(frontmostAppS,sizeof(frontmostAppS),0); SBFrontmostApplicationDisplayIdentifier(p,frontmostAppS); NSString * frontmostApp=[NSString stringWithFormat:@"%s",frontmostAppS]; //NSLog(@"Frontmost app is %@",frontmostApp); //get list of running apps from SpringBoard NSArray *allApplications = SBSCopyApplicationDisplayIdentifiers(p,NO, NO); for(NSString *identifier in allApplications) { NSString *locName=SBSCopyLocalizedApplicationNameForDisplayIdentifier(p,identifier);NSLog(@"Active Application:%@",identifier); } – Saroj Ojha Apr 16 '12 at 11:13
  • I want to use this code in my app , but I am getting error Undefined symbols for architecture i386: "_SBSCopyLocalizedApplicationNameForDisplayIdentifier", referenced from: -[ViewController getActiveApps] in ViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) – Saroj Ojha Apr 16 '12 at 11:14
1

it will not run on iOS 8 as apple take is as a vulnerability to get the process id of current running app.but you can get a list of all the processes running in background or foreground.

Muhammad Waqas Bhati
  • 2,775
  • 20
  • 25
  • This is not really an answer imho. Could you provide some support for your claim, please? E.g. show with code how it could be done. – kkuilla Oct 22 '14 at 14:52
  • this link will give you all the list of processes running http://stackoverflow.com/questions/8252396/how-to-determine-which-apps-are-background-and-which-app-is-foreground-on-ios-by – Muhammad Waqas Bhati Oct 23 '14 at 20:57