You master, can not use c language to execute adb shell, the interface is generated so documents released to the upper.
System Environment Requirements Andrews in windows can, but in Andrews, returned no adb command input terminal adb commands directly Andrews is, I understand, probably in the next Andrews, adb application is not available for calls c program, I use Cygwin cross compiler is compiling, expert help!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Try to invoke the command via system-related commands inside the adb shell
Reply:
On the phone without adb ah, adb and pc is used, can be executed directly System
Reply:
Is to use the system to achieve, but the system () operation can be successful locally, but the system () to operate the remote device is unsuccessful,
Reply:
Questions added:
with c codeJNIEXPORT jint JNICALL Java_com_known_util_device_DeviceUtil_installApk
(JNIEnv * env, jobject objet, jstring js)
{Char buf [200] = "";
/ / Char str [200] = "";
char * str = (char *) env-> GetStringUTFChars (js, 0);
sprintf (buf, "adb install-r% s", str);
int i = system ("adb install / mnt / sdcard / ApkInstall / A.apk");
usleep (1000);
return i;
} Execute i = 256, no successful implementation
But enter adb install / mnt / sdcard / ApkInstall / A.apk directly on the terminal, run successfully.
Reply:
adb communicate directly and adbd phone, see your downloading needs apk want it quiet mode, with root privileges before they can
Reply:
already have root privileges,
Entered directly on the terminal adb install / mnt / sdcard / ApkInstall / A.apk, it is possible, but not with c code
Reply:
Several LS told you explain so clearly
android adb is used to operate the equipment inside, but you certainly do not have this android, ah
Installation can try using pm install-r path
Reply:
Installation is definitely installed, or entered directly in the terminal command does not run successfully, tanwei4199 you read my question carefully, and then reply. Thank you
Reply:
I tried it on my nexus4 about even with adb command and then try to install the apk discover what the results are not waiting for the device waiting for device
Reply:
LZ want android phone / tablet to another phone / tablet install applications it?
Reply:
I ask you to call installApk application layer application has first obtain root privileges? APP is certainly not calling privileges
Reply:
No one replies useful, experts expect replies
Reply:
The landlord or the first to master the basics right adb
Reply:
Boy, look adb source, adb is a socket client, perform the installation on the phone commands are invoked pm, unloaded
No comments:
Post a Comment