Giter VIP home page Giter VIP logo

kpappmananger's Introduction

功能

  • 静默安装APP,卸载,打开,监听。
  • 进程间通信。
  • 获取设备UDID。
  • 后台保活。

集成

  • 直接使用
pod 'KPAppMananger', :git => 'https://github.com/LZRight123/KPAppMananger.git'
  • clone到本地
git clone https://github.com/LZRight123/KPAppMananger.git
pod 'KPAppMananger', :path => '../KPAppMananger'

用法

  • 获取设备UDID
[KPAppTool UDID]
// 获取设备信息,包括UDID 本机名称 机身颜色 等
[KPAppTool deviceInfo]
  • 后台保活 Signing & Capabilities -> BackgroundModes -> Audio
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[KPBackgroundTaskUtils sharedInstance] playNoVoliceBackgroundTask];
    return YES;
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    [[KPBackgroundTaskUtils sharedInstance] applicationDidEnterBackgroundTask:application];
}
  • 操作app
/// 安装本地
[KPAppTool installAppWithIpaPath:self.ipaPath appIdentfier:nil block:^(NSString *installDesc, NSString *completionDesc) {
    //... 
}];

/// url
[KPAppTool installAppWithRemoteURL:@"your ipa url" downloadProgress:nil completion:nil];

/// 卸载
[KPAppTool uninstallApplication:nil options:nil];

/// 打开
[KPAppTool openApplicationWithBundleID:nil];
  • IPC通知
/// 服务端:ping
[KPAppToolInstance pingTimeSecond:3];
[KPAppToolInstance registerIPCNotfication:@"kp.test.pong" callBack:^(NSString *name) {
    //....
}];
/// 客户端
[KPAppToolInstance recevicePingCallBack:^(NSString *name) {
    NSLog(@"接收到了ping: %@", name);
    [KPAppToolInstance postIPCNoftication:@"kp.test.pong"];
}];
  • 进程间收发消息
 [KPLocalConnect registerLisenerAtPort:5555 callBack:^NSDictionary * _Nonnull(NSString * _Nonnull path, NSDictionary * _Nonnull query) {
     if ([path isEqualToString:@"/xxxpath"]) {
         return @{
             @"path": path?:@"",
             @"quey": query?:@{},
         };
     }
     return @{
         @"msg": @"path is error",
     };
 }];
 
 /// 客户端
 [KPLocalConnect getAtPort:5555 path:@"xxxpath" parameters:@{@"key1": @"value"} completion:^(NSDictionary * _Nonnull response, NSError * _Nonnull error, NSURLSessionDataTask * _Nonnull task) {
     NSLog(@"response: %@", response);;
 }];

kpappmananger's People

Contributors

lzright123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kpappmananger's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.