Ejemplo n.º 1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public StartActivityReceiver(IStartActivityListener listener)
 {
     this.listener = listener;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Start an given activity in the given package.
 /// Throws an exception when starting fails.
 /// </summary>
 public void StartActivity(IDevice device, string packageName, string activityName, bool debuggable, int timeout, IStartActivityListener listener)
 {
     var component = packageName + "/" + activityName;
     var receiver = new StartActivityReceiver(listener);
     using (var socket = new AdbRequest(EndPoint))
     {
         try
         {
             var args = new List<string>();
             args.Add("start");
             if (debuggable) args.Add("-D");
             args.Add("-n");
             args.Add(component);
             socket.ExecuteShellCommand(receiver, device, timeout, "am", args.ToArray());
         }
         catch (Exception ex)
         {
             throw new AdbException(string.Format("Failed to start activity because: {0}", ex.Message));
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Start an given activity in the given package.
        /// Throws an exception when starting fails.
        /// </summary>
        public void StartActivity(IDevice device, string packageName, string activityName, bool debuggable, int timeout, IStartActivityListener listener)
        {
            var component = packageName + "/" + activityName;
            var receiver  = new StartActivityReceiver(listener);

            using (var socket = new AdbRequest(EndPoint))
            {
                try
                {
                    var args = new List <string>();
                    args.Add("start");
                    if (debuggable)
                    {
                        args.Add("-D");
                    }
                    args.Add("-n");
                    args.Add(component);
                    socket.ExecuteShellCommand(receiver, device, timeout, "am", args.ToArray());
                }
                catch (Exception ex)
                {
                    throw new AdbException(string.Format("Failed to start activity because: {0}", ex.Message));
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public StartActivityReceiver(IStartActivityListener listener)
 {
     this.listener = listener;
 }