本文整理汇总了Java中com.android.SdkConstants.FN_ADB属性的典型用法代码示例。如果您正苦于以下问题:Java SdkConstants.FN_ADB属性的具体用法?Java SdkConstants.FN_ADB怎么用?Java SdkConstants.FN_ADB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.SdkConstants
的用法示例。
在下文中一共展示了SdkConstants.FN_ADB属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AdbWrapper
/**
* Creates a new lightweight ADB wrapper.
*
* @param osSdkPath The root OS path of the SDK. Cannot be null.
* @param monitor A logger object. Cannot be null.
*/
public AdbWrapper(String osSdkPath, ITaskMonitor monitor) {
mMonitor = monitor;
if (!osSdkPath.endsWith(File.separator)) {
osSdkPath += File.separator;
}
mAdbOsLocation = osSdkPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER
+ SdkConstants.FN_ADB;
}
示例2: create
/**
* Manually create a new package with one archive and the given attributes or properties.
* This is used to create packages from local directories in which case there must be
* one archive which URL is the actual target location.
* <p/>
* By design, this creates a package with one and only one archive.
*/
public static Package create(
SdkSource source,
Properties props,
int revision,
String license,
String description,
String descUrl,
String archiveOsPath) {
PlatformToolPackage ptp = new PlatformToolPackage(source, props, revision, license,
description, descUrl, archiveOsPath);
File platformToolsFolder = new File(archiveOsPath);
String error = null;
if (!platformToolsFolder.isDirectory()) {
error = "platform-tools folder is missing";
} else {
File[] files = platformToolsFolder.listFiles();
if (files == null || files.length == 0) {
error = "platform-tools folder is empty";
} else {
Set<String> names = new HashSet<String>();
for (File file : files) {
names.add(file.getName());
}
// Package-tools revision 17+ matches sdk-repository-8 and above
// and only requires adb (other tools moved to the build-tool packages.)
String[] expected = new String[] { SdkConstants.FN_ADB };
if (ptp.getRevision().getMajor() < 17) {
// Platform-tools before revision 17 should have adb, aapt, aidl and dx.
expected = new String[] { SdkConstants.FN_ADB,
SdkConstants.FN_AAPT,
SdkConstants.FN_AIDL,
SdkConstants.FN_DX };
}
for (String name : expected) {
if (!names.contains(name)) {
if (error == null) {
error = "platform-tools folder is missing ";
} else {
error += ", ";
}
error += name;
}
}
}
}
if (error != null) {
String shortDesc = ptp.getShortDescription() + " [*]"; //$NON-NLS-1$
String longDesc = String.format(
"Broken Platform-Tools Package: %1$s\n" +
"[*] Package cannot be used due to error: %2$s",
description,
error);
BrokenPackage ba = new BrokenPackage(props, shortDesc, longDesc,
IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED,
IExactApiLevelDependency.API_LEVEL_INVALID,
archiveOsPath,
PkgDesc.Builder.newPlatformTool(ptp.getRevision())
.setDescriptionShort(shortDesc)
.create());
return ba;
}
return ptp;
}